diff options
author | David Emett <dave@sp4m.net> | 2019-03-11 00:43:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-27 19:28:23 +0300 |
commit | cf90c06f8115016fa4a94644a26a4ba093f0055e (patch) | |
tree | f04dd71ce7cc87167823a6333b31220a1805c9df /drivers/tty/tty_jobctrl.c | |
parent | 3adf2aa8af2d5122917b78988de9cdeb828cdd9d (diff) | |
download | linux-cf90c06f8115016fa4a94644a26a4ba093f0055e.tar.xz |
tty: fix read of tty->pgrp outside of ctrl_lock
The intention was clearly to use the tty_pgrp local variable rather than
re-read tty->pgrp outside of ctrl_lock, so do that.
This bug was introduced by commit 2812d9e9fd94 ("tty: Combine
SIGTTOU/SIGTTIN handling").
Signed-off-by: David Emett <dave@sp4m.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_jobctrl.c')
-rw-r--r-- | drivers/tty/tty_jobctrl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c index 1393f71bb170..f8ed50a16848 100644 --- a/drivers/tty/tty_jobctrl.c +++ b/drivers/tty/tty_jobctrl.c @@ -44,7 +44,7 @@ int __tty_check_change(struct tty_struct *tty, int sig) tty_pgrp = tty->pgrp; spin_unlock_irqrestore(&tty->ctrl_lock, flags); - if (tty_pgrp && pgrp != tty->pgrp) { + if (tty_pgrp && pgrp != tty_pgrp) { if (is_ignored(sig)) { if (sig == SIGTTIN) ret = -EIO; |