All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: gadget: composite: fix NULL pointer when a non standard request is received
@ 2018-03-15  8:34 patrice.chotard at st.com
  2018-04-26 13:13 ` Patrice CHOTARD
  0 siblings, 1 reply; 5+ messages in thread
From: patrice.chotard at st.com @ 2018-03-15  8:34 UTC (permalink / raw)
  To: u-boot

From: Christophe Kerello <christophe.kerello@st.com>

In case usb configuration is unknown (cdev->config == NULL), non standard
request should not be processed.
Remove also the cdev->config check below which will never happen.

This issue was seen using ums feature.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---
 drivers/usb/gadget/composite.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index d0ee7847b98d..a87639def974 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -838,6 +838,9 @@ unknown:
 			ctrl->bRequestType, ctrl->bRequest,
 			w_value, w_index, w_length);
 
+		if (!cdev->config)
+			goto done;
+
 		/*
 		 * functions always handle their interfaces and endpoints...
 		 * punt other recipients (other, WUSB, ...) to the current
@@ -882,7 +885,7 @@ unknown:
 			value = f->setup(f, ctrl);
 		else {
 			c = cdev->config;
-			if (c && c->setup)
+			if (c->setup)
 				value = c->setup(c, ctrl);
 		}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] usb: gadget: composite: fix NULL pointer when a non standard request is received
  2018-03-15  8:34 [U-Boot] [PATCH] usb: gadget: composite: fix NULL pointer when a non standard request is received patrice.chotard at st.com
@ 2018-04-26 13:13 ` Patrice CHOTARD
  2018-04-26 13:15   ` Marek Vasut
  2018-04-26 13:17   ` Lukasz Majewski
  0 siblings, 2 replies; 5+ messages in thread
From: Patrice CHOTARD @ 2018-04-26 13:13 UTC (permalink / raw)
  To: u-boot

Hi

It's a gentle reminder as this patch is present on mailing list since 5 
weeks without any feedback.

Thanks

On 03/15/2018 09:34 AM, patrice.chotard at st.com wrote:
> From: Christophe Kerello <christophe.kerello@st.com>
> 
> In case usb configuration is unknown (cdev->config == NULL), non standard
> request should not be processed.
> Remove also the cdev->config check below which will never happen.
> 
> This issue was seen using ums feature.
> 
> Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
>   drivers/usb/gadget/composite.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index d0ee7847b98d..a87639def974 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -838,6 +838,9 @@ unknown:
>   			ctrl->bRequestType, ctrl->bRequest,
>   			w_value, w_index, w_length);
>   
> +		if (!cdev->config)
> +			goto done;
> +
>   		/*
>   		 * functions always handle their interfaces and endpoints...
>   		 * punt other recipients (other, WUSB, ...) to the current
> @@ -882,7 +885,7 @@ unknown:
>   			value = f->setup(f, ctrl);
>   		else {
>   			c = cdev->config;
> -			if (c && c->setup)
> +			if (c->setup)
>   				value = c->setup(c, ctrl);
>   		}
>   
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] usb: gadget: composite: fix NULL pointer when a non standard request is received
  2018-04-26 13:13 ` Patrice CHOTARD
@ 2018-04-26 13:15   ` Marek Vasut
  2018-04-26 13:17   ` Lukasz Majewski
  1 sibling, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2018-04-26 13:15 UTC (permalink / raw)
  To: u-boot

On 04/26/2018 03:13 PM, Patrice CHOTARD wrote:
> Hi
> 
> It's a gentle reminder as this patch is present on mailing list since 5 
> weeks without any feedback.

This should've been like a third non-gentle ping, seriously, two weeks
without feedback is already sucky. Time to buzz Lukasz, although he is
probably busy with personal stuff these days.

Applied

> Thanks
> 
> On 03/15/2018 09:34 AM, patrice.chotard at st.com wrote:
>> From: Christophe Kerello <christophe.kerello@st.com>
>>
>> In case usb configuration is unknown (cdev->config == NULL), non standard
>> request should not be processed.
>> Remove also the cdev->config check below which will never happen.
>>
>> This issue was seen using ums feature.
>>
>> Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
>> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>> ---
>>   drivers/usb/gadget/composite.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
>> index d0ee7847b98d..a87639def974 100644
>> --- a/drivers/usb/gadget/composite.c
>> +++ b/drivers/usb/gadget/composite.c
>> @@ -838,6 +838,9 @@ unknown:
>>   			ctrl->bRequestType, ctrl->bRequest,
>>   			w_value, w_index, w_length);
>>   
>> +		if (!cdev->config)
>> +			goto done;
>> +
>>   		/*
>>   		 * functions always handle their interfaces and endpoints...
>>   		 * punt other recipients (other, WUSB, ...) to the current
>> @@ -882,7 +885,7 @@ unknown:
>>   			value = f->setup(f, ctrl);
>>   		else {
>>   			c = cdev->config;
>> -			if (c && c->setup)
>> +			if (c->setup)
>>   				value = c->setup(c, ctrl);
>>   		}
>>   


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] usb: gadget: composite: fix NULL pointer when a non standard request is received
  2018-04-26 13:13 ` Patrice CHOTARD
  2018-04-26 13:15   ` Marek Vasut
@ 2018-04-26 13:17   ` Lukasz Majewski
  2018-04-27  7:52     ` Patrice CHOTARD
  1 sibling, 1 reply; 5+ messages in thread
From: Lukasz Majewski @ 2018-04-26 13:17 UTC (permalink / raw)
  To: u-boot

Hi Patrice,

> Hi
> 
> It's a gentle reminder as this patch is present on mailing list since
> 5 weeks without any feedback.

Deepest apologizes for the delay.

I will test this patch - as some Samsung SoCs may use this feature and
let you know. 

> 
> Thanks
> 
> On 03/15/2018 09:34 AM, patrice.chotard at st.com wrote:
> > From: Christophe Kerello <christophe.kerello@st.com>
> > 
> > In case usb configuration is unknown (cdev->config == NULL), non
> > standard request should not be processed.
> > Remove also the cdev->config check below which will never happen.
> > 
> > This issue was seen using ums feature.
> > 
> > Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
> > Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> > ---
> >   drivers/usb/gadget/composite.c | 5 ++++-
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/usb/gadget/composite.c
> > b/drivers/usb/gadget/composite.c index d0ee7847b98d..a87639def974
> > 100644 --- a/drivers/usb/gadget/composite.c
> > +++ b/drivers/usb/gadget/composite.c
> > @@ -838,6 +838,9 @@ unknown:
> >   			ctrl->bRequestType, ctrl->bRequest,
> >   			w_value, w_index, w_length);
> >   
> > +		if (!cdev->config)
> > +			goto done;
> > +
> >   		/*
> >   		 * functions always handle their interfaces and
> > endpoints...
> >   		 * punt other recipients (other, WUSB, ...) to
> > the current @@ -882,7 +885,7 @@ unknown:
> >   			value = f->setup(f, ctrl);
> >   		else {
> >   			c = cdev->config;
> > -			if (c && c->setup)
> > +			if (c->setup)
> >   				value = c->setup(c, ctrl);
> >   		}
> >   
> >  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180426/90311f33/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] usb: gadget: composite: fix NULL pointer when a non standard request is received
  2018-04-26 13:17   ` Lukasz Majewski
@ 2018-04-27  7:52     ` Patrice CHOTARD
  0 siblings, 0 replies; 5+ messages in thread
From: Patrice CHOTARD @ 2018-04-27  7:52 UTC (permalink / raw)
  To: u-boot

Thanks Lukasz ;-)

On 04/26/2018 03:17 PM, Lukasz Majewski wrote:
> Hi Patrice,
> 
>> Hi
>>
>> It's a gentle reminder as this patch is present on mailing list since
>> 5 weeks without any feedback.
> 
> Deepest apologizes for the delay.
> 
> I will test this patch - as some Samsung SoCs may use this feature and
> let you know.
> 
>>
>> Thanks
>>
>> On 03/15/2018 09:34 AM, patrice.chotard at st.com wrote:
>>> From: Christophe Kerello <christophe.kerello@st.com>
>>>
>>> In case usb configuration is unknown (cdev->config == NULL), non
>>> standard request should not be processed.
>>> Remove also the cdev->config check below which will never happen.
>>>
>>> This issue was seen using ums feature.
>>>
>>> Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
>>> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>>> ---
>>>    drivers/usb/gadget/composite.c | 5 ++++-
>>>    1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/usb/gadget/composite.c
>>> b/drivers/usb/gadget/composite.c index d0ee7847b98d..a87639def974
>>> 100644 --- a/drivers/usb/gadget/composite.c
>>> +++ b/drivers/usb/gadget/composite.c
>>> @@ -838,6 +838,9 @@ unknown:
>>>    			ctrl->bRequestType, ctrl->bRequest,
>>>    			w_value, w_index, w_length);
>>>    
>>> +		if (!cdev->config)
>>> +			goto done;
>>> +
>>>    		/*
>>>    		 * functions always handle their interfaces and
>>> endpoints...
>>>    		 * punt other recipients (other, WUSB, ...) to
>>> the current @@ -882,7 +885,7 @@ unknown:
>>>    			value = f->setup(f, ctrl);
>>>    		else {
>>>    			c = cdev->config;
>>> -			if (c && c->setup)
>>> +			if (c->setup)
>>>    				value = c->setup(c, ctrl);
>>>    		}
>>>    
>>>   
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-27  7:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15  8:34 [U-Boot] [PATCH] usb: gadget: composite: fix NULL pointer when a non standard request is received patrice.chotard at st.com
2018-04-26 13:13 ` Patrice CHOTARD
2018-04-26 13:15   ` Marek Vasut
2018-04-26 13:17   ` Lukasz Majewski
2018-04-27  7:52     ` Patrice CHOTARD

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.