Re: [PATCH V3] usbnet: fix race condition caused spinlock bad magic issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oliver Neukum <oliver@xxxxxxxxxx> writes:

> On Thu, 2013-11-14 at 10:03 +0800, wangbiao wrote:
>> From: wang, biao <biao.wang@xxxxxxxxx>
>> Date: Mon, 11 Nov 2013 10:23:40 +0800
>> Subject: [PATCH] usbnet: fix race condition caused spinlock bad magic issue
>> 
>> there is race between usbnet_terminate_urbs and usbnet_bh.
>> for example:
>>     cpu 0                                     cpu 1
>>                                           usbnet_suspend
>> usbnet_bh {                               ->usbnet_terminate_urbs {
>>                                               dev->wait = &unlink_wakeup;
>>                                               while(....){..}//break
>>     if(dev->wait) is true
>>                        		              dev->wait=NULL
>>                                           }//unlink_wakeup is invalid
>>     __wake_up(dev->wait)//garbage value
>> }
>> 
>> the race is due to unprotection of dev->wait, so this patch involves a
>> spinlock to avoid it.
>> 
>> Signed-off-by: wang, biao <biao.wang@xxxxxxxxx>
>> Signed-off-by: Zhang, Di <di.zhang@xxxxxxxxx>
> Acked-by: Oliver Neukum <oliver@xxxxxxxxxx>


Really?  Serializing the suspend of all usbnet devices seems like a good
idea?


Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux