aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-10-15 05:52:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-15 13:19:51 -0400
commit7c3b1dcf13d5660152e02c6dea47b0bd9fd5d871 (patch)
tree72965f7aaec65c6822523e77626d733e9957c19d /drivers
parent6d54aaf389bb47f30fd6567b88665689967be642 (diff)
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: Marcin Slusarz <marcin.slusarz@gmail.com> Tested-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tty_io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 7053d6333692..3f48d88cffc0 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3032,11 +3032,12 @@ EXPORT_SYMBOL(tty_devnum);
3032 3032
3033void proc_clear_tty(struct task_struct *p) 3033void proc_clear_tty(struct task_struct *p)
3034{ 3034{
3035 unsigned long flags;
3035 struct tty_struct *tty; 3036 struct tty_struct *tty;
3036 spin_lock_irq(&p->sighand->siglock); 3037 spin_lock_irqsave(&p->sighand->siglock, flags);
3037 tty = p->signal->tty; 3038 tty = p->signal->tty;
3038 p->signal->tty = NULL; 3039 p->signal->tty = NULL;
3039 spin_unlock_irq(&p->sighand->siglock); 3040 spin_unlock_irqrestore(&p->sighand->siglock, flags);
3040 tty_kref_put(tty); 3041 tty_kref_put(tty);
3041} 3042}
3042 3043