From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] usb: core: buffer: avoid NULL pointer dereferrence
Date: Tue, 26 Apr 2016 16:11:15 -0700 [thread overview]
Message-ID: <20160426231115.GB23273@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1604081120190.2069-100000@iolanthe.rowland.org>
On Fri, Apr 08, 2016 at 11:21:05AM -0400, Alan Stern wrote:
> On Fri, 8 Apr 2016, Greg Kroah-Hartman wrote:
>
> > On Fri, Apr 08, 2016 at 05:08:03PM +0800, Chunfeng Yun wrote:
> > > NULL pointer dereferrence will happen when class driver
> > > wants to allocate zero length buffer and pool_max[0]
> > > can't be used, so skip reserved pool in this case.
> >
> > Why would a driver want to allocate a 0 length buffer? What driver does
> > this?
> >
> > Shouldn't we fix that issue instead?
>
> And even if a driver does want to allocate a 0-length buffer, shouldn't
> the function simply return early instead of running through all its
> calculations?
Yes it should, Chunfeng, can you fix this patch to do that please.
thanks,
greg k-h
next prev parent reply other threads:[~2016-04-26 23:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 9:08 [PATCH] usb: core: buffer: avoid NULL pointer dereferrence Chunfeng Yun
[not found] ` <1460106483-24793-1-git-send-email-chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2016-04-08 14:07 ` Greg Kroah-Hartman
[not found] ` <20160408140701.GA3547-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2016-04-08 15:21 ` Alan Stern
2016-04-26 23:11 ` Greg Kroah-Hartman [this message]
[not found] ` <20160426231115.GB23273-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2016-04-27 1:32 ` chunfeng yun
2016-04-11 3:01 ` chunfeng yun
2016-04-11 5:07 ` Felipe Balbi
2016-04-11 7:16 ` chunfeng yun
2016-04-11 8:24 ` Felipe Balbi
2016-04-11 14:44 ` Alan Stern
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=20160426231115.GB23273@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=chunfeng.yun@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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