Page MenuHomeFreeBSD

proc: Disallow re-enabling of process itimers during exit
ClosedPublic

Authored by markj on Thu, Mar 27, 10:32 AM.
Tags
None
Referenced Files
F114391264: D49529.diff
Sat, Apr 12, 1:33 AM
Unknown Object (File)
Wed, Apr 9, 12:58 AM
Unknown Object (File)
Wed, Apr 9, 12:57 AM
Unknown Object (File)
Wed, Apr 9, 12:57 AM
Unknown Object (File)
Wed, Apr 9, 12:57 AM
Unknown Object (File)
Tue, Apr 1, 6:28 AM
Unknown Object (File)
Mon, Mar 31, 11:58 AM
Unknown Object (File)
Fri, Mar 28, 5:41 AM
Subscribers

Details

Summary

During process exit, it's possible for the exiting thread to send a
signal to its process, via killjobc(). This happens after the itimer is
drained. If itimers are stopped, i.e., P2_ITSTOPPED is set, then
itimer_proc_continue() will resume the callout after it has been
drained.

Fix the problem by simply clearing P2_ITSTOPPED as part of the drain.
Then, a signal received after that point will not re-enable the callout.

Reported by: syzkaller

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I think this is fine.
But also I suggest to add the check for P_WEXIT/P_KILLED before re-arming the itimer callouts.

This revision is now accepted and ready to land.Thu, Mar 27, 4:59 PM

Check for P_WEXIT in realitexpire_reset_callout() too.

This revision now requires review to proceed.Fri, Mar 28, 8:54 AM
This revision is now accepted and ready to land.Fri, Mar 28, 3:22 PM