提交 7c3b1dcf 编写于 作者: A Arjan van de Ven 提交者: Linus Torvalds

tty: make sure that proc_clear_tty stores the cpu flags

proc_clear_tty() gets called with interrupts off (while holding the task list
lock) from sys_setid. This means that it needs the _irqsave version of the
locking primitives.
Reported-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6d54aaf3
......@@ -3032,11 +3032,12 @@ EXPORT_SYMBOL(tty_devnum);
void proc_clear_tty(struct task_struct *p)
{
unsigned long flags;
struct tty_struct *tty;
spin_lock_irq(&p->sighand->siglock);
spin_lock_irqsave(&p->sighand->siglock, flags);
tty = p->signal->tty;
p->signal->tty = NULL;
spin_unlock_irq(&p->sighand->siglock);
spin_unlock_irqrestore(&p->sighand->siglock, flags);
tty_kref_put(tty);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册