HomeFreeBSD

proc: Disallow re-enabling of process itimers during exit

Description

proc: Disallow re-enabling of process itimers during exit

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.
For good measure, also make sure that we don't reset the itimer callout
in an exiting process.

Reported by: syzkaller
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D49529

Details

Provenance
markjAuthored on Mon, Mar 31, 1:22 AM
Reviewer
kib
Differential Revision
D49529: proc: Disallow re-enabling of process itimers during exit
Parents
rGfe7fe3b175b6: rangelock: Fix handling of trylocks
Branches
Unknown
Tags
Unknown