Sep 22, 2017, 9:18:12 AM9/22/17
to Arvind Yadav, Hans Verkuil, Mauro Carvalho Chehab, Laurent Pinchart, linux...@vger.kernel.org, LKML, Dmitry Vyukov, Kostya Serebryany, syzkaller
On Fri, Sep 22, 2017 at 3:09 PM, Arvind Yadav <arvind....@gmail.com
> Hi Andrey,
> On Friday 22 September 2017 05:16 PM, Andrey Konovalov wrote:
>> On Fri, Sep 22, 2017 at 9:41 AM, Arvind Yadav <arvind....@gmail.com
>>> I have a doubt. Why we are calling flush_work in hdpvr_probe for every
>>> We are flushing work which is not defined yet.
>>> Here, hdpvr_register_videodev() is responsible for setup and register a
>>> video device.
>>> Also defining and initializing a worker. we are calling
>>> hdpvr_register_videodev() at last.
>>> No need to flash any work here.
>>> Please correct me, if I am wrong.
>> Hi Arvind,
>> I believe you're right, no need to call flush_work() before
>> dev->worker is initialized.
>> Could you send a fix?
>> I'm able to reproduce the issue, so I can test your patches if needed.
> I have send a one patch to you. which will resolve this error. But my
> question is why
> hdpvr_probe() is failing. We need to find out. Could please share more
> information and logs.
The patch helps, thanks!
hdpvr_probe() is failing, because I'm attaching a malicious USB device
that pretends to be an hdpvr device, but doesn't have a bulk-in
[ 27.722420] gadgetfs: bound to dummy_udc driver
[ 27.990245] usb 1-1: new full-speed USB device number 2 using dummy_hcd
[ 28.010242] gadgetfs: connected
[ 28.011732] gadgetfs: disconnected
[ 28.230142] gadgetfs: connected
[ 28.330313] usb 1-1: config 8 has an invalid interface number: 217
but max is 0
[ 28.331981] usb 1-1: config 8 has no interface number 0
[ 28.410315] usb 1-1: New USB device found, idVendor=2040, idProduct=4903
[ 28.411826] usb 1-1: New USB device strings: Mfr=0, Product=0,
[ 28.413477] usb 1-1: SerialNumber: a
[ 28.440134] gadgetfs: configuration #8
[ 28.467705] hdpvr 1-1:8.217: Could not find bulk-in endpoint
[ 28.469024] hdpvr: probe of 1-1:8.217 failed with error -12
[ 29.446584] gadgetfs: disconnected
[ 29.449634] usb 1-1: USB disconnect, device number 2