mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Phong Tran <tranmanphong@gmail.com>
To: Paul Bolle <pebolle@tiscali.nl>,
	isdn@linux-pingi.de, gregkh@linuxfoundation.org
Cc: tranmanphong@gmail.com, gigaset307x-common@lists.sourceforge.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	syzbot+35b1c403a14f5c89eba7@syzkaller.appspotmail.com
Subject: Re: [PATCH] isdn/gigaset: check endpoint null in gigaset_probe
Date: Sat, 27 Jul 2019 08:56:02 +0700	[thread overview]
Message-ID: <24cd0b70-45e6-ea98-fc8f-b25fbf6e817f@gmail.com> (raw)
In-Reply-To: <1876196a0e7fc665f0f50d5e9c0e2641f713e089.camel@tiscali.nl>

On 7/26/19 9:22 PM, Paul Bolle wrote:
> Phong Tran schreef op vr 26-07-2019 om 20:35 [+0700]:
>> This fixed the potential reference NULL pointer while using variable
>> endpoint.
>>
>> Reported-by: syzbot+35b1c403a14f5c89eba7@syzkaller.appspotmail.com
>> Tested by syzbot:
>> https://groups.google.com/d/msg/syzkaller-bugs/wnHG8eRNWEA/Qn2HhjNdBgAJ
>>
>> Signed-off-by: Phong Tran <tranmanphong@gmail.com>
>> ---
>>   drivers/isdn/gigaset/usb-gigaset.c | 9 +++++++++
> 
> This is now drivers/staging/isdn/gigaset/usb-gigaset.c.

this patch was created base on branch 
kasan/usb-fuzzer-usb-testing-2019.07.11 [1]
I did not notice about the driver was moved to staging.

> 
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
>> index 1b9b43659bdf..2e011f3db59e 100644
>> --- a/drivers/isdn/gigaset/usb-gigaset.c
>> +++ b/drivers/isdn/gigaset/usb-gigaset.c
>> @@ -703,6 +703,10 @@ static int gigaset_probe(struct usb_interface *interface,
>>   	usb_set_intfdata(interface, cs);
>>   
>>   	endpoint = &hostif->endpoint[0].desc;
>> +        if (!endpoint) {
>> +		dev_err(cs->dev, "Couldn't get control endpoint\n");
>> +		return -ENODEV;
>> +	}
> 
> When can this happen? Is this one of those bugs that one can only trigger with
> a specially crafted (evil) usb device?
> 

Yes, in my understanding, this only happens with random test of syzbot.

>>   	buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
>>   	ucs->bulk_out_size = buffer_size;
>> @@ -722,6 +726,11 @@ static int gigaset_probe(struct usb_interface *interface,
>>   	}
>>   
>>   	endpoint = &hostif->endpoint[1].desc;
>> +        if (!endpoint) {
>> +		dev_err(cs->dev, "Endpoint not available\n");
>> +		retval = -ENODEV;
>> +		goto error;
>> +	}
>>   
>>   	ucs->busy = 0;
>>   
> 
> Please note that I'm very close to getting cut off from the ISDN network, so
> the chances of being able to testi this on a live system are getting small.
> 

This bug can be invalid now. Do you agree?
There is an instruction to report invalid bug to syzbot [2].

> Thanks,
> 
> 
> Paul Bolle
> 


[1] 
https://github.com/google/kasan/commits/usb-fuzzer-usb-testing-2019.07.11
[2] 
https://github.com/google/syzkaller/blob/master/docs/syzbot.md#communication-with-syzbot

Thanks,
Phong

  reply	other threads:[~2019-07-27  1:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26 13:35 Phong Tran
2019-07-26 14:22 ` Paul Bolle
2019-07-27  1:56   ` Phong Tran [this message]
2019-07-27  9:36     ` Paul Bolle

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=24cd0b70-45e6-ea98-fc8f-b25fbf6e817f@gmail.com \
    --to=tranmanphong@gmail.com \
    --cc=gigaset307x-common@lists.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=isdn@linux-pingi.de \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pebolle@tiscali.nl \
    --cc=syzbot+35b1c403a14f5c89eba7@syzkaller.appspotmail.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

all inboxes | Powered by JetHome®