mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
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 <oleg@redhat.com> Reported-by: Catalin Marinas <catalin.marinas@arm.com> Reported-and-tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Acked-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
483f64c430
commit
6da8d866d0
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user