Created attachment 219174 [details] 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.
A commit references this bug: Author: kib Date: Wed Oct 28 22:12:47 UTC 2020 New revision: 367120 URL: https://svnweb.freebsd.org/changeset/base/367120 Log: 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 Changes: head/sys/kern/tty.c
A commit references this bug: Author: kib Date: Wed Nov 11 00:43:13 UTC 2020 New revision: 367582 URL: https://svnweb.freebsd.org/changeset/base/367582 Log: MFC r367120: Check for process group change in tty_wait_background(). PR: 250701 Changes: _U stable/12/ stable/12/sys/kern/tty.c
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>