Commit 6da8d866 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

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: default avatarOleg Nesterov <oleg@redhat.com>
Reported-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reported-and-tested-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Acked-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 483f64c4
...@@ -1423,6 +1423,8 @@ static void release_one_tty(struct work_struct *work) ...@@ -1423,6 +1423,8 @@ static void release_one_tty(struct work_struct *work)
list_del_init(&tty->tty_files); list_del_init(&tty->tty_files);
file_list_unlock(); file_list_unlock();
put_pid(tty->pgrp);
put_pid(tty->session);
free_tty_struct(tty); free_tty_struct(tty);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment