From: Oleg Nesterov Date: Fri, 2 Apr 2010 16:05:12 +0000 (+0200) Subject: tty: release_one_tty() forgets to put pids X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6da8d866d0d39e9509ff826660f6a86a6757c966;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Reported-by: Catalin Marinas Reported-and-tested-by: Tetsuo Handa Acked-by: Linus Torvalds Acked-by: Eric W. Biederman Signed-off-by: Linus Torvalds --- 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); }