Page MenuHomeFreeBSD

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

Authored by markj on Mar 27 2025, 10:32 AM.
Tags
None
Referenced Files
F147496549: D49529.id.diff
Wed, Mar 11, 10:44 AM
F147470777: D49529.id.diff
Wed, Mar 11, 6:40 AM
F147434999: D49529.id.diff
Tue, Mar 10, 11:42 PM
Unknown Object (File)
Feb 8 2026, 11:28 AM
Unknown Object (File)
Feb 7 2026, 11:37 PM
Unknown Object (File)
Feb 7 2026, 8:12 PM
Unknown Object (File)
Jan 31 2026, 11:14 AM
Unknown Object (File)
Jan 29 2026, 5:03 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 63170
Build 60054: arc lint + arc unit

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.Mar 27 2025, 4:59 PM

Check for P_WEXIT in realitexpire_reset_callout() too.

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