Page MenuHomeFreeBSD

Add STKGAP disable fctl flag.
ClosedPublic

Authored by kib on Nov 15 2019, 9:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 28, 7:24 PM
Unknown Object (File)
Mar 4 2024, 5:11 AM
Unknown Object (File)
Feb 12 2024, 4:16 PM
Unknown Object (File)
Jan 13 2024, 11:22 PM
Unknown Object (File)
Jan 3 2024, 9:55 PM
Unknown Object (File)
Dec 20 2023, 7:12 AM
Unknown Object (File)
Sep 30 2023, 11:47 AM
Unknown Object (File)
Sep 20 2023, 11:20 AM
Subscribers

Details

Summary

This also fixes a bug where p_osrel and p_fctl0 were obliterated by failed execve(2) attempt, to be committed separately.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/kern_exec.c
398 ↗(On Diff #64363)

Perhaps sysctl_kern_proc_osrel() should look up the process with PGET_NOTINEXEC.

402 ↗(On Diff #64363)

Doesn't this need to happen after imgp is initialized below?

877 ↗(On Diff #64363)

Why write imgp->proc instead of p?

kib marked 2 inline comments as done.Nov 15 2019, 9:21 PM
kib added inline comments.
sys/kern/kern_exec.c
398 ↗(On Diff #64363)

I do not think so, it would cause spurious failures from the sysctl. Would NOTINEXEC was implemented as a wait for transition to non-execing state, then perhaps. But I think it is fine to see transient move of p_osrel during failing exec.

Only use imgp after it is initialized, and use p later.

markj added inline comments.
sys/kern/kern_exec.c
410 ↗(On Diff #64398)

We can use p here too.

This revision is now accepted and ready to land.Nov 15 2019, 9:28 PM
sys/kern/kern_exec.c
398 ↗(On Diff #64363)

I was thinking that since the sysctl can update the p_osrel, its update may be clobbered when we roll back after a failed exec. But of course this race is possible even when the exec is successful.

kib marked an inline comment as done.

One more 'p'.

This revision now requires review to proceed.Nov 15 2019, 9:49 PM
This revision is now accepted and ready to land.Nov 15 2019, 9:53 PM