linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>, Bin Liu <b-liu@ti.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH 2/2] usb: musb: Fix a possible null-pointer dereference in musb_handle_intr_connect()
Date: Wed, 11 Dec 2019 09:09:10 +0100	[thread overview]
Message-ID: <20191211080910.GA426347@kroah.com> (raw)
In-Reply-To: <20191210165454.13772-3-b-liu@ti.com>

On Tue, Dec 10, 2019 at 10:54:54AM -0600, Bin Liu wrote:
> From: Jia-Ju Bai <baijiaju1990@gmail.com>
> 
> In musb_handle_intr_connect(), there is an if statement on line 783 to
> check whether musb->hcd is NULL:
>     if (musb->hcd)
> 
> When musb->hcd is NULL, it is used on line 797:
>     musb_host_poke_root_hub(musb);
>         if (musb->hcd->status_urb)
> 
> Thus, a possible null-pointer dereference may occur.

Maybe, if musb->hcd really ever could be NULL.

In looking at the code, I don't see where that could happen, do you?
Why is that check there in the first place?

What sets musb->hcd to NULL in the first place?

thanks,

greg k-h

  reply	other threads:[~2019-12-11  8:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 16:54 [PATCH 0/2] musb fixes for v5.5-rc2 Bin Liu
2019-12-10 16:54 ` [PATCH 1/2] usb: musb: sunxi: propagate devicetree node to glue pdev Bin Liu
2019-12-11  8:05   ` Greg Kroah-Hartman
2019-12-11  8:49     ` Johan Hovold
2019-12-11  8:51       ` Greg Kroah-Hartman
2019-12-11  8:53         ` Johan Hovold
2019-12-10 16:54 ` [PATCH 2/2] usb: musb: Fix a possible null-pointer dereference in musb_handle_intr_connect() Bin Liu
2019-12-11  8:09   ` Greg Kroah-Hartman [this message]
2019-12-11  9:10     ` Jia-Ju Bai
2019-12-11  9:20       ` Greg Kroah-Hartman
2019-12-17  8:26         ` Jia-Ju Bai

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=20191211080910.GA426347@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=b-liu@ti.com \
    --cc=baijiaju1990@gmail.com \
    --cc=linux-usb@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).