]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Check for process group change in tty_wait_background().
authorkib <kib@FreeBSD.org>
Wed, 28 Oct 2020 22:12:47 +0000 (22:12 +0000)
committerkib <kib@FreeBSD.org>
Wed, 28 Oct 2020 22:12:47 +0000 (22:12 +0000)
commit8cd0b5b206e487786a7e38d71413a125d7364755
tree4f69a57860aab30fcfe147b5f2747d7a08ae288e
parent4e81b08fc28491231eec3b2ec8613940fcda9c7a
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.  Re-check that the process group hasn't changed after acquiring
the pgrp lock, and if it has, redo the checks.

PR: 250701
Submitted by: Jakub Piecuch <j.piecuch96@gmail.com>
MFC after: 2 weeks
sys/kern/tty.c