HomeFreeBSD

kevent: Fix races between timer detach and kqtimer_proc_continue()

Description

kevent: Fix races between timer detach and kqtimer_proc_continue()

  • When detaching a knote, we need to double check the enqueued flag after acquiring the process lock, as kqtimer_proc_continue() may have toggled it.
  • kqtimer_proc_continue() could in principle reschedule a stopped callout after filt_timerdetach() drains the callout. So, we need to re-check.

Reported by: syzbot+4a4cebb3ec07892cb040@syzkaller.appspotmail.com
Reported by: syzbot+a9c04bc76078a3b7dd8d@syzkaller.appspotmail.com
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31772

Details

Provenance
markjAuthored on Sep 1 2021, 6:18 PM
Reviewer
kib
Differential Revision
D31772: kevent: Fix races between timer detach and kqtimer_proc_continue()
Parents
rGd491b42535db: pf tests: altq:codel_bridge requires if_bridge
Branches
Unknown
Tags
Unknown