From 1ae9213b109c56470b79df5af1e36e780916eb57 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 2 Apr 2010 18:05:12 +0200 Subject: 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 Reported-by: Catalin Marinas Reported-and-tested-by: Tetsuo Handa Acked-by: Linus Torvalds Acked-by: Eric W. Biederman Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/char/tty_io.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- cgit v1.2.3-18-g5258