FreeBSD Bugzilla – Attachment 219174 Details for
Bug 250701
[tty] [patch] Race condition between tty_wait_background() and doenterpgrp()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch: check for process group change in tty_wait_background()
patch (text/plain), 553 bytes, created by
Jakub Piecuch
on 2020-10-28 19:47:39 UTC
(
hide
)
Description:
Patch: check for process group change in tty_wait_background()
Filename:
MIME Type:
Creator:
Jakub Piecuch
Created:
2020-10-28 19:47:39 UTC
Size:
553 bytes
patch
obsolete
>diff --git a/sys/kern/tty.c b/sys/kern/tty.c >index 5cdaa10728d..1df66abd653 100644 >--- a/sys/kern/tty.c >+++ b/sys/kern/tty.c >@@ -474,6 +474,17 @@ tty_wait_background(struct tty *tp, struct thread *td, int sig) > sig = 0; > } > PGRP_LOCK(pg); >+ /* >+ * pg may no longer be our process group. >+ * Run the checks again if that's the case. >+ */ >+ PROC_LOCK(p); >+ if (__predict_false(p->p_pgrp != pg)) { >+ PROC_UNLOCK(p); >+ PGRP_UNLOCK(pg); >+ continue; >+ } >+ PROC_UNLOCK(p); > pgsignal(pg, ksi.ksi_signo, 1, &ksi); > PGRP_UNLOCK(pg); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 250701
: 219174