diff options
author | Oleg Nesterov <oleg@redhat.com> | 2010-04-02 18:05:12 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-26 14:27:06 -0700 |
commit | 1ae9213b109c56470b79df5af1e36e780916eb57 (patch) | |
tree | 43639d0912ce81b2847dde414aa81a7ddcb9da46 | |
parent | c18cb57f81d42eb408fa7f0fb15b9f4f3f9998fb (diff) |
tty: release_one_tty() forgets to put pids
commit 6da8d866d0d39e9509ff826660f6a86a6757c966 upstream.
release_one_tty(tty) can be called when tty still has a reference
to pgrp/session. In this case we leak the pid.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-and-tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/char/tty_io.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index e6788f44f97..f325128776d 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1893,6 +1893,8 @@ static void release_one_tty(struct tty_struct *tty, int idx) list_del_init(&tty->tty_files); file_list_unlock(); + put_pid(tty->pgrp); + put_pid(tty->session); free_tty_struct(tty); } |