Re: Possible double-free in the usbnet driver

2016-03-08 Thread Andrey Konovalov
On Tue, Mar 8, 2016 at 12:39 AM, Oliver Neukum wrote: > On Mon, 2016-03-07 at 22:50 +0300, Andrey Konovalov wrote: >> Could you also add: >> Reported-by: Andrey Konovalov > > Well, the exact bug you reported is fixed in Bjorn's > patch the way Linus suggested. I'm fixing just a further > race tha

Re: Possible double-free in the usbnet driver

2016-03-07 Thread Oliver Neukum
On Mon, 2016-03-07 at 22:50 +0300, Andrey Konovalov wrote: > Could you also add: > Reported-by: Andrey Konovalov Well, the exact bug you reported is fixed in Bjorn's patch the way Linus suggested. I'm fixing just a further race that would require an error condition on top of what you have seen. S

Re: Possible double-free in the usbnet driver

2016-03-07 Thread David Miller
From: Andrey Konovalov Date: Mon, 7 Mar 2016 22:50:41 +0300 > On Mon, Mar 7, 2016 at 10:11 PM, David Miller wrote: >> From: Linus Torvalds >> Date: Mon, 7 Mar 2016 10:13:09 -0800 >> >>> On Sat, Mar 5, 2016 at 11:53 AM, Bjørn Mork wrote: Definitely. The patch is so obviously cor

Re: Possible double-free in the usbnet driver

2016-03-07 Thread Andrey Konovalov
On Mon, Mar 7, 2016 at 10:11 PM, David Miller wrote: > From: Linus Torvalds > Date: Mon, 7 Mar 2016 10:13:09 -0800 > >> On Sat, Mar 5, 2016 at 11:53 AM, Bjørn Mork wrote: >>> >>> >>> Definitely. The patch is so obviously correct that we can only wonder how >>> it was possible to miss it it the

Re: Possible double-free in the usbnet driver

2016-03-07 Thread David Miller
From: Linus Torvalds Date: Mon, 7 Mar 2016 10:13:09 -0800 > On Sat, Mar 5, 2016 at 11:53 AM, Bjørn Mork wrote: >> >> >> Definitely. The patch is so obviously correct that we can only wonder how >> it was possible to miss it it the first place :) >> >> Will take a look to see if we could do a b

Re: Possible double-free in the usbnet driver

2016-03-07 Thread Linus Torvalds
On Sat, Mar 5, 2016 at 11:53 AM, Bjørn Mork wrote: > > > Definitely. The patch is so obviously correct that we can only wonder how it > was possible to miss it it the first place :) > > Will take a look to see if we could do a better job cleaning up in other > places. What should I do for 4.5?

Re: Possible double-free in the usbnet driver

2016-03-07 Thread Dmitry Vyukov
On Fri, Mar 4, 2016 at 11:43 PM, Linus Torvalds wrote: > On Fri, Mar 4, 2016 at 2:26 PM, Andrey Konovalov wrote: >> >> and when I run the vm and connect the device I get: >> >> [ 23.672662] cdc_ncm 1-1:1.6: bind() failure >> [ 23.673447] usbnet_probe(): freeing netdev: 88006ab48000 >> [

Re: Possible double-free in the usbnet driver

2016-03-05 Thread Bjørn Mork
On March 5, 2016 4:51:30 PM CET, Oliver Neukum wrote: >On Fri, 2016-03-04 at 14:43 -0800, Linus Torvalds wrote: > >> So you have usbnet_defer_kevent() getting triggered, which in turn >> ends up using "usbnet->kevent" >> >> But somebody like Oliver is really the right person to check this. >For

Re: Possible double-free in the usbnet driver

2016-03-05 Thread Oliver Neukum
On Fri, 2016-03-04 at 14:43 -0800, Linus Torvalds wrote: > So you have usbnet_defer_kevent() getting triggered, which in turn > ends up using "usbnet->kevent" > > But somebody like Oliver is really the right person to check this. For > example, it's entirely possible that we should just instead d

Re: Possible double-free in the usbnet driver

2016-03-04 Thread Andrey Konovalov
On Sat, Mar 5, 2016 at 2:00 AM, Andrey Konovalov wrote: > On Sat, Mar 5, 2016 at 1:42 AM, Oliver Neukum wrote: >> On Sat, 2016-03-05 at 01:26 +0300, Andrey Konovalov wrote: >>> and when I run the vm and connect the device I get: >>> >>> [ 23.672662] cdc_ncm 1-1:1.6: bind() failure >>> [ 23.67

Re: Possible double-free in the usbnet driver

2016-03-04 Thread Andrey Konovalov
On Sat, Mar 5, 2016 at 1:42 AM, Oliver Neukum wrote: > On Sat, 2016-03-05 at 01:26 +0300, Andrey Konovalov wrote: >> and when I run the vm and connect the device I get: >> >> [ 23.672662] cdc_ncm 1-1:1.6: bind() failure >> [ 23.673447] usbnet_probe(): freeing netdev: 88006ab48000 >> [ 23

Re: Possible double-free in the usbnet driver

2016-03-04 Thread Andrey Konovalov
On Sat, Mar 5, 2016 at 1:43 AM, Linus Torvalds wrote: > On Fri, Mar 4, 2016 at 2:26 PM, Andrey Konovalov wrote: >> >> and when I run the vm and connect the device I get: >> >> [ 23.672662] cdc_ncm 1-1:1.6: bind() failure >> [ 23.673447] usbnet_probe(): freeing netdev: 88006ab48000 >> [

Re: Possible double-free in the usbnet driver

2016-03-04 Thread Oliver Neukum
On Sat, 2016-03-05 at 01:26 +0300, Andrey Konovalov wrote: > and when I run the vm and connect the device I get: > > [ 23.672662] cdc_ncm 1-1:1.6: bind() failure > [ 23.673447] usbnet_probe(): freeing netdev: 88006ab48000 > [ 23.675822] usbnet_probe(): freeing netdev: 88006ab48000 >

Re: Possible double-free in the usbnet driver

2016-03-04 Thread Linus Torvalds
On Fri, Mar 4, 2016 at 2:26 PM, Andrey Konovalov wrote: > > and when I run the vm and connect the device I get: > > [ 23.672662] cdc_ncm 1-1:1.6: bind() failure > [ 23.673447] usbnet_probe(): freeing netdev: 88006ab48000 > [ 23.675822] usbnet_probe(): freeing netdev: 88006ab48000 > >

Re: Possible double-free in the usbnet driver

2016-03-04 Thread Andrey Konovalov
On Sat, Mar 5, 2016 at 12:26 AM, Linus Torvalds wrote: > [ Moving this to proper lists ] > > On Thu, Mar 3, 2016 at 4:19 PM, Andrey Konovalov wrote: >> >> I found another double-free, this time in the usbnet driver. > > Hmm. It doesn't look like a double free to me, at least from the logs > you a

Re: Possible double-free in the usbnet driver

2016-03-04 Thread Linus Torvalds
[ Moving this to proper lists ] On Thu, Mar 3, 2016 at 4:19 PM, Andrey Konovalov wrote: > > I found another double-free, this time in the usbnet driver. Hmm. It doesn't look like a double free to me, at least from the logs you attached. > Whenever the `bind()` function fails (drivers/net/usb/us