[Bug 250701] [tty] [patch] Race condition between tty_wait_background() and doenterpgrp()
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Oct 28 19:47:40 UTC 2020
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250701
Bug ID: 250701
Summary: [tty] [patch] Race condition between
tty_wait_background() and doenterpgrp()
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: kern
Assignee: bugs at FreeBSD.org
Reporter: j.piecuch96 at gmail.com
Created attachment 219174
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=219174&action=edit
Patch: check for process group change in tty_wait_background()
The calling process's process group can change between PROC_UNLOCK(p) and
PGRP_LOCK(pg) in tty_wait_background(), e.g. by a setpgid() call from another
process. If that happens, the signal is not sent to the calling process, even
if the prior checks determine that one should be sent.
The patch checks that the process group hasn't changed after acquiring the pgrp
lock, and if it has, it redoes the checks.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list