All of lore.kernel.org
 help / color / mirror / Atom feed
From: nirinA raseliarison <nirina.raseliarison@gmail.com>
To: "Guenter Roeck" <linux@roeck-us.net>,
	"Ming Lei" <ming.lei@canonical.com>
Cc: "nirinA raseliarison" <nirina.raseliarison@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Francois Romieu" <romieu@fr.zoreil.com>,
	nic_swsd@realtek.com, "Hayes Wang" <hayeswang@realtek.com>
Subject: Re: BUG: unable to handle kernel NULL pointer dereference at 0000000000000040
Date: Sat, 15 Jun 2013 19:43:10 +0300	[thread overview]
Message-ID: <op.wyqbd8qn9ey1ta@localhost> (raw)
In-Reply-To: <CACVXFVPVA0N=99K7VXNcGpz6=vE+v-FcebS2iUBwo6V3zR=_og@mail.gmail.com>

on Sat, 15 Jun 2013 11:08:47 +0300, Ming Lei <ming.lei@canonical.com>  
wrote:

> On Sat, Jun 15, 2013 at 2:30 PM, Guenter Roeck <linux@roeck-us.net>  
> wrote:
>> On Sat, Jun 15, 2013 at 10:32:14AM +0800, Ming Lei wrote:
>>> On Sat, Jun 15, 2013 at 1:07 AM, nirinA raseliarison
>>> <nirina.raseliarison@gmail.com> wrote:
>>>
>>> > patch applied and no longer have the bug message when i
>>> > reboot and wake up the ethernet controller.
>>>
>>> I am wondering if Guenter's patch can fix the race really, but I'd  
>>> like to
>>> see Guenter's explanation on his patch.
>>>
>>> The race should be caused by below:
>>>
>>> - request timeout triggered by internal timer
>>>
>>> - user space aborts the requests before the line in  
>>> _request_firmware_load()
>>>
>>>              fw_priv->buf = NULL
>>>
>>> which is run in timeout path
>>>
>>> - then the abort() called from firmware_loading_store() may use a  
>>> freed fw buf
>>> since the timeout path will free the fw buffer.
>>>
>>> Considered clearing 'fw_priv->buf' in _request_firmware_load()() isn't  
>>> protected
>>> by fw_lock now, so Guenter's patch can't avoid the race entirely.
>>>
>> I agree; my patch only protects one specific path, and was based on the
>> observation that access to fw_priv->buf is protected elsewhwere in the  
>> code.
>> My suspicion was that fw_priv->buf was freed while waiting for the  
>> mutex in
>> firmware_loading_store().
>>
>> Your patch is more comprehensive.
>
> OK, thanks for your reply.
>
> I will post out one version for merge, and this one moves the
> "fw_priv->buf = NULL;" into fw_load_abort() for simplifying change.

this is just to let you know that i've tested Ming Lei's latest patch.
thank you very much for the fix and the explanation.

-- 
nirinA

  reply	other threads:[~2013-06-15 16:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14 12:49 BUG: unable to handle kernel NULL pointer dereference at 0000000000000040 nirinA raseliarison
2013-06-14 14:30 ` Bjorn Helgaas
2013-06-14 15:45   ` Guenter Roeck
2013-06-14 17:07     ` nirinA raseliarison
2013-06-15  2:32       ` Ming Lei
2013-06-15  6:30         ` Guenter Roeck
2013-06-15  8:08           ` Ming Lei
2013-06-15 16:43             ` nirinA raseliarison [this message]
2013-06-14 17:02   ` Ming Lei
2013-06-14 18:32     ` nirinA raseliarison

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=op.wyqbd8qn9ey1ta@localhost \
    --to=nirina.raseliarison@gmail.com \
    --cc=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=ming.lei@canonical.com \
    --cc=nic_swsd@realtek.com \
    --cc=romieu@fr.zoreil.com \
    /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.