* [PATCH] tty: make sure that proc_clear_tty stores the cpu flags
@ 2008-10-15 9:52 Alan Cox
0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2008-10-15 9:52 UTC (permalink / raw)
To: torvalds, linux-kernel
From: Arjan van de Ven <arjan@linux.intel.com>
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>
---
drivers/char/tty_io.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 7053d63..3f48d88 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -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);
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-15 9:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15 9:52 [PATCH] tty: make sure that proc_clear_tty stores the cpu flags Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox