public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Dr. H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Felipe Balbi <balbi@ti.com>,
	linux-usb@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Marek Belisko <marek@goldelico.com>
Subject: Re: [PATCH 1 of 1]: musb: fixed a potential NULL pointer dereference.
Date: Wed, 12 Feb 2014 06:29:45 -0800	[thread overview]
Message-ID: <20140212142945.GA9172@kroah.com> (raw)
In-Reply-To: <AAE255E2-8388-48FD-B728-D633862DBFB4@goldelico.com>

On Wed, Feb 12, 2014 at 11:08:22AM +0100, Dr. H. Nikolaus Schaller wrote:
> fixed a potential NULL pointer dereference.
>     
>     Rationale:
>     this is the only location in the musb driver where the
>     otg->gadget pointer is dereferenced. Assuming that it
>     is never NULL is not only potentially unsafe but was
>     observed in the wild on a GTA04 (OMAP3/TPS65950 based
>     board) when trying to boot a device tree based 3.14-rc2
>     kernel with USB cable plugged in.
>     
>     DT boot appears to modify the order in which components
>     (gadget driver) are loaded and linked and therefore
>     an early musb interrupt triggers with a NULL gadget
>     pointer ending in a kernel panic.
>     
>     Since a non-existing gadget can never be "active" we
>     simply use a 0 value for musb->is_active.
>     
>     Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>

Please don't attach patches, our tools don't like them at all.

And shouldn't we fix the root problem here, not just gloss over the fact
that this pointer is NULL at this point in time?  Fixing the real issue
should be the correct solution, right?

thanks,

greg k-h

  reply	other threads:[~2014-02-12 14:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 10:08 [PATCH 1 of 1]: musb: fixed a potential NULL pointer dereference Dr. H. Nikolaus Schaller
2014-02-12 14:29 ` Greg Kroah-Hartman [this message]
2014-02-12 15:35   ` Dr. H. Nikolaus Schaller
2014-02-12 16:20     ` Greg Kroah-Hartman
2014-02-13 18:30       ` Dr. H. Nikolaus Schaller

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=20140212142945.GA9172@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@ti.com \
    --cc=hns@goldelico.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marek@goldelico.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox