From: Greg KH on
2.6.27-stable review patch. If anyone has any objections, please let us know.


From: Oleg Nesterov <oleg(a)>

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(a)>
Reported-by: Catalin Marinas <catalin.marinas(a)>
Reported-and-tested-by: Tetsuo Handa <penguin-kernel(a)>
Acked-by: Linus Torvalds <torvalds(a)>
Acked-by: Eric W. Biederman <ebiederm(a)>
Signed-off-by: Linus Torvalds <torvalds(a)>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)>

drivers/char/tty_io.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1893,6 +1893,8 @@ static void release_one_tty(struct tty_s

+ put_pid(tty->pgrp);
+ put_pid(tty->session);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at