commit
24ec839c431eb79bb8f6abc00c4e1eb3b8c4d517 while fixing the locking for
signal->tty got the locking wrong for signal->session. This places our
accesses of signal->session back under the tasklist_lock where they belong.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
{
struct tty_struct *tty;
int tty_pgrp = -1;
- int session;
lock_kernel();
spin_lock_irq(¤t->sighand->siglock);
current->signal->tty_old_pgrp = 0;
- session = process_session(current);
spin_unlock_irq(¤t->sighand->siglock);
mutex_lock(&tty_mutex);
/* Now clear signal->tty under the lock */
read_lock(&tasklist_lock);
- session_clear_tty(session);
+ session_clear_tty(process_session(current));
read_unlock(&tasklist_lock);
unlock_kernel();
}