All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Greg KH <gregkh@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [crash] NULL pointer dereference at IP: [<ffffffff812e9ccb>] uart_close+0x2a/0x1e4
Date: Mon, 12 Oct 2009 13:55:49 +0200	[thread overview]
Message-ID: <20091012115549.GA13987@elte.hu> (raw)
In-Reply-To: <20091012124501.3c1ac94f@lxorguk.ukuu.org.uk>


* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> > Unfortunately 46d57a449aa13d9c6adcc9d1dbc7b9a0ecfb69d8 is not easy to 
> > revert, at all. Would be glad to try any patch - fixes or some manual 
> > revert as well (if that's feasible).
> 
> The patch doesn't do anything but create local variables of 
> state->port. I'm now glad I did it that way as it makes it easy to 
> spot the mistake.
>
> the tty_port lock is ->lock, the uart lock is ->lock both are 
> different..
> 
> Spot the mistake:
> 
>  	if (state->flags & UIF_INITIALIZED) {
>  		unsigned long flags;
>  		spin_lock_irqsave(&port->lock, flags);
> -		port->ops->stop_rx(port);
> +		uport->ops->stop_rx(uport);
>  		spin_unlock_irqrestore(&port->lock, flags);
>  		/*
>  		 * Before we drop DTR, make sure the UART transmitter
>  		 * has completely drained; this is especially
>  		 * important if there is a transmit FIFO!
>  		 */
> -		uart_wait_until_sent(tty, port->timeout);
> +		uart_wait_until_sent(tty, uport->timeout);
>  	}
> 
> 
> so uart_close takes the wrong lock. I've checked the rest of the patch 
> for the same error and I don't see any other screwups.

Cool! This very much looks like something that could fix both problems. 
I've started testing your fix.

And yeah, i too never ever regretted having done 'too finegrained' 
patches. (only ever the other way around) They are a pleasure to bisect 
back to.

> [...] The race in question is very hard to hit but fortunately Ingo 
> hit it twice..

a hundred thousand bootups a year go a long way in finding narrow races 
;-)

	Ingo

  reply	other threads:[~2009-10-12 11:56 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-11 21:58 Linux 2.6.32-rc4 Linus Torvalds
2009-10-12  7:42 ` [origin tree build failure] [PATCH] Revert "USB: musb: make HAVE_CLK support optional" Ingo Molnar
2009-10-12 13:05   ` Mike Frysinger
2009-10-12 14:29     ` Greg KH
2009-10-12 14:39       ` Mike Frysinger
2009-10-12 15:00         ` Ingo Molnar
2009-10-12 15:09           ` Mike Frysinger
2009-10-12 13:49   ` [PATCH] USB: musb: invert arch depend string Mike Frysinger
2009-10-12 14:28     ` Greg KH
2009-10-12 15:02       ` Ingo Molnar
2009-10-12  8:05 ` [crash] NULL pointer dereference at IP: [<ffffffff812e9ccb>] uart_close+0x2a/0x1e4 Ingo Molnar
2009-10-12  9:19   ` Ingo Molnar
2009-10-12  9:27     ` Ingo Molnar
2009-10-12 11:25       ` Ingo Molnar
2009-10-12 11:45         ` Alan Cox
2009-10-12 11:55           ` Ingo Molnar [this message]
2009-10-12 12:22             ` Ingo Molnar
2009-10-12 13:06               ` Alan Cox
2009-10-12 14:23                 ` Ingo Molnar
2009-10-12 16:19   ` Linus Torvalds
2009-10-12 16:26     ` Ingo Molnar
2009-10-12 16:28     ` Ingo Molnar
2009-10-12 16:37     ` Linus Torvalds
2009-10-12 17:13       ` [PATCH] tty, serial: Fix race and NULL check in uart_close() Ingo Molnar
2009-10-12  8:29 ` Linux 2.6.32-rc4 Ingo Molnar
2009-10-12  8:30   ` [origin tree build failure] [PATCH] headers: Fix build in drivers/pci/hotplug/cpqphp.h Ingo Molnar
2009-10-12  8:32   ` [origin tree build failure] [PATCH] headers: Fix build in drivers/char/rtc.c Ingo Molnar
2009-10-12  8:40   ` [origin tree build failure] [PATCH] headers: Fix build in drivers/net/wan/pci200syn.c Ingo Molnar
2009-10-12  9:11   ` [origin tree build failure] [PATCH] headers: Fix build in drivers/net/wan/n2.c Ingo Molnar
2009-10-12  9:16   ` [origin tree build failure] [PATCH] headers: Fix build in drivers/net/wan/c101.c Ingo Molnar
2009-10-12 10:06   ` [origin tree build failure] [PATCH] headers: Fix build in drivers/char/genrtc.c Ingo Molnar
2009-10-12 13:29   ` Linux 2.6.32-rc4 Alexey Dobriyan
2009-10-12  9:43     ` Ingo Molnar
2009-10-12 13:34   ` Alexey Dobriyan
2009-10-12  9:48     ` Ingo Molnar
2009-10-12 14:22   ` [origin tree build failure] [PATCH] headers: Fix build in drivers/char/sonypi.c Ingo Molnar
2009-10-12 13:01 ` Linux 2.6.32-rc4 Thomas Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091012115549.GA13987@elte.hu \
    --to=mingo@elte.hu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.