aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <[email protected]>2010-04-02 18:05:12 +0200
committerLinus Torvalds <[email protected]>2010-04-02 19:44:09 -0700
commit6da8d866d0d39e9509ff826660f6a86a6757c966 (patch)
tree1d8637ba7ef67ac3df8a67cc59c79551575e25da
parent483f64c430ad981188d865ee635f3f7a469f0b12 (diff)
tty: release_one_tty() forgets to put pids
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 <[email protected]> Reported-by: Catalin Marinas <[email protected]> Reported-and-tested-by: Tetsuo Handa <[email protected]> Acked-by: Linus Torvalds <[email protected]> Acked-by: Eric W. Biederman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--drivers/char/tty_io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index a42c466f7092..6da962c9b21c 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1423,6 +1423,8 @@ static void release_one_tty(struct work_struct *work)
list_del_init(&tty->tty_files);
file_list_unlock();
+ put_pid(tty->pgrp);
+ put_pid(tty->session);
free_tty_struct(tty);
}