lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9eba7e43-5692-b9c7-b30c-39a60e3239a6@ti.com>
Date:   Thu, 22 Aug 2019 16:37:39 +0300
From:   Roger Quadros <rogerq@...com>
To:     Alan Stern <stern@...land.harvard.edu>
CC:     <balbi@...nel.org>, <gregkh@...uxfoundation.org>,
        <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: gadget: udc: core: Fix error case while binding
 pending gadget drivers



On 21/08/2019 17:30, Alan Stern wrote:
> On Wed, 21 Aug 2019, Roger Quadros wrote:
> 
>> If binding a pending gadget driver fails we should not
>> remove it from the pending driver list, otherwise it
>> will cause a segmentation fault later when the gadget driver is
>> unloaded.
> 
>> Signed-off-by: Roger Quadros <rogerq@...com>
>> ---
>>  drivers/usb/gadget/udc/core.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
>> index 7cf34beb50df..c272c8014772 100644
>> --- a/drivers/usb/gadget/udc/core.c
>> +++ b/drivers/usb/gadget/udc/core.c
>> @@ -1142,7 +1142,7 @@ static int check_pending_gadget_drivers(struct usb_udc *udc)
>>  		if (!driver->udc_name || strcmp(driver->udc_name,
>>  						dev_name(&udc->dev)) == 0) {
>>  			ret = udc_bind_to_driver(udc, driver);
>> -			if (ret != -EPROBE_DEFER)
>> +			if (!ret)
>>  				list_del(&driver->pending);
>>  			break;
>>  		}
> 
> This is kind of a policy question.  If binding a pending gadget driver 
> fails, should the driver remain pending?
> 
> Depending on the answer to this question, you might want to change the 
> list_del to list_del_init.  That should fix the segmentation fault 
> just as well.

OK. I'll send a revised patch to retain existing policy.

cheers,
-roger
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ