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, Nov 17, 10:55 AM
Unknown Object (File)
Fri, Nov 15, 11:58 AM
Unknown Object (File)
Thu, Nov 14, 2:45 AM
Unknown Object (File)
Sat, Nov 2, 4:55 AM
Unknown Object (File)
Sat, Nov 2, 2:31 AM
Unknown Object (File)
Mon, Oct 28, 2:25 PM
Unknown Object (File)
Sep 29 2024, 9:29 PM
Unknown Object (File)
Sep 23 2024, 11:36 PM
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