[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081013145712.5aa06871@infradead.org>
Date: Mon, 13 Oct 2008 14:57:12 -0400
From: Arjan van de Ven <arjan@...radead.org>
To: Marcin Slusarz <marcin.slusarz@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Alan Cox <alan@...hat.com>,
Dmitry Torokhov <dtor@...l.ru>
Subject: Re: inconsistent lock state (tty? input?)
On Mon, 13 Oct 2008 20:37:43 +0200
Marcin Slusarz <marcin.slusarz@...il.com> wrote:
> On current git (a447c0932445f92ce6f4c1bd020f62c5097a7842):
\
good spotting;
the patch below should fix this:
>From 26c117549415c55585f46ad38cd58a5f84f5adc7 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@...ux.intel.com>
Date: Mon, 13 Oct 2008 14:56:39 -0400
Subject: [PATCH] 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@...il.com>
Signed-off-by: Arjan van de Ven <arjan@...ux.intel.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 e4dce87..4715961 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3595,9 +3595,10 @@ EXPORT_SYMBOL(tty_devnum);
void proc_clear_tty(struct task_struct *p)
{
- spin_lock_irq(&p->sighand->siglock);
+ unsigned long flags;
+ spin_lock_irqsave(&p->sighand->siglock, flags);
p->signal->tty = NULL;
- spin_unlock_irq(&p->sighand->siglock);
+ spin_unlock_irqrestore(&p->sighand->siglock, flags);
}
/* Called under the sighand lock */
--
1.5.5.1
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists