From: Felipe Balbi <felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: chunfeng yun
<chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH] usb: core: buffer: avoid NULL pointer dereferrence
Date: Mon, 11 Apr 2016 08:07:28 +0300 [thread overview]
Message-ID: <87shyspwbz.fsf@intel.com> (raw)
In-Reply-To: <1460343705.10419.12.camel@mhfsdcap03>
[-- Attachment #1: Type: text/plain, Size: 912 bytes --]
Hi,
chunfeng yun <chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> writes:
> On Fri, 2016-04-08 at 07:07 -0700, 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?
> It's misc/usbtest.c
that'll do what you ask it to do with the userspace tool testusb. Are
you trying to pass a size of 0 ?
>> Shouldn't we fix that issue instead?
> I don't know which way is better, but it seems simple to fix it up in
> buffer.c
I think we should, really, avoid a 0-length allocation, but passing a
size of 0 to testusb isn't very good either ;-) How are you calling
testusb ?
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: felipe.balbi@linux.intel.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] usb: core: buffer: avoid NULL pointer dereferrence
Date: Mon, 11 Apr 2016 08:07:28 +0300 [thread overview]
Message-ID: <87shyspwbz.fsf@intel.com> (raw)
In-Reply-To: <1460343705.10419.12.camel@mhfsdcap03>
Hi,
chunfeng yun <chunfeng.yun@mediatek.com> writes:
> On Fri, 2016-04-08 at 07:07 -0700, 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?
> It's misc/usbtest.c
that'll do what you ask it to do with the userspace tool testusb. Are
you trying to pass a size of 0 ?
>> Shouldn't we fix that issue instead?
> I don't know which way is better, but it seems simple to fix it up in
> buffer.c
I think we should, really, avoid a 0-length allocation, but passing a
size of 0 to testusb isn't very good either ;-) How are you calling
testusb ?
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160411/f31cbb2b/attachment.sig>
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <felipe.balbi@linux.intel.com>
To: chunfeng yun <chunfeng.yun@mediatek.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: 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: Mon, 11 Apr 2016 08:07:28 +0300 [thread overview]
Message-ID: <87shyspwbz.fsf@intel.com> (raw)
In-Reply-To: <1460343705.10419.12.camel@mhfsdcap03>
[-- Attachment #1: Type: text/plain, Size: 885 bytes --]
Hi,
chunfeng yun <chunfeng.yun@mediatek.com> writes:
> On Fri, 2016-04-08 at 07:07 -0700, 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?
> It's misc/usbtest.c
that'll do what you ask it to do with the userspace tool testusb. Are
you trying to pass a size of 0 ?
>> Shouldn't we fix that issue instead?
> I don't know which way is better, but it seems simple to fix it up in
> buffer.c
I think we should, really, avoid a 0-length allocation, but passing a
size of 0 to testusb isn't very good either ;-) How are you calling
testusb ?
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2016-04-11 5:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 9:08 [PATCH] usb: core: buffer: avoid NULL pointer dereferrence Chunfeng Yun
2016-04-08 9:08 ` Chunfeng Yun
2016-04-08 9:08 ` 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
2016-04-08 14:07 ` Greg Kroah-Hartman
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-08 15:21 ` Alan Stern
2016-04-08 15:21 ` Alan Stern
2016-04-26 23:11 ` Greg Kroah-Hartman
2016-04-26 23:11 ` Greg Kroah-Hartman
[not found] ` <20160426231115.GB23273-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2016-04-27 1:32 ` chunfeng yun
2016-04-27 1:32 ` chunfeng yun
2016-04-27 1:32 ` chunfeng yun
2016-04-11 3:01 ` chunfeng yun
2016-04-11 3:01 ` chunfeng yun
2016-04-11 3:01 ` chunfeng yun
2016-04-11 5:07 ` Felipe Balbi [this message]
2016-04-11 5:07 ` Felipe Balbi
2016-04-11 5:07 ` Felipe Balbi
2016-04-11 7:16 ` chunfeng yun
2016-04-11 7:16 ` chunfeng yun
2016-04-11 7:16 ` chunfeng yun
2016-04-11 8:24 ` Felipe Balbi
2016-04-11 8:24 ` Felipe Balbi
2016-04-11 8:24 ` Felipe Balbi
2016-04-11 14:44 ` Alan Stern
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=87shyspwbz.fsf@intel.com \
--to=felipe.balbi-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.