lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080724065329.GE17724@gollum.tnic>
Date:	Thu, 24 Jul 2008 08:53:29 +0200
From:	Borislav Petkov <petkovbb@...glemail.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>, linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [lockdep warning] INFO: inconsistent lock state,
	serial8250_interrupt(), &port_lock_key

On Wed, Jul 23, 2008 at 11:36:04AM +0200, Ingo Molnar wrote:
> 
> * Ingo Molnar <mingo@...e.hu> wrote:
> 
> > =================================
> > [ INFO: inconsistent lock state ]
> > 2.6.26-tip-06509-gb4ebc67-dirty #13600
> > ---------------------------------
> 
> the upstream component of that is: v2.6.26-6077-gc010b2f
> 
> i.e. my suspicion is that this got introduced via the recent tty 
> changes.

Hi,

i hit the same warning here. How about the following fix (this is at least what
i think happens):
--

serial8250_startup() might unconditionally enable irqs after releasing
&up->port.lock while we're still servicing an interrupt.

Signed-off-by: Borislav Petkov <petkovbb@...il.com>

--
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 27f34a9..55eca08 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1874,7 +1874,7 @@ static int serial8250_startup(struct uart_port *port)
 		 * the interrupt is enabled.  Delays are necessary to
 		 * allow register changes to become visible.
 		 */
-		spin_lock(&up->port.lock);
+		spin_lock_irqsave(&up->port.lock, flags);
 		if (up->port.flags & UPF_SHARE_IRQ)
 			disable_irq_nosync(up->port.irq);
 
@@ -1890,7 +1890,7 @@ static int serial8250_startup(struct uart_port *port)
 
 		if (up->port.flags & UPF_SHARE_IRQ)
 			enable_irq(up->port.irq);
-		spin_unlock(&up->port.lock);
+		spin_unlock_irqrestore(&up->port.lock, flags);
 
 		/*
 		 * If the interrupt is not reasserted, setup a timer to

-- 
Regards/Gruß,
    Boris.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ