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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 28 Jun 2012 10:35:19 +0200
From:	Oliver Neukum <oneukum@...e.de>
To:	Ming Lei <tom.leiming@...il.com>
Cc:	Bjørn Mork <bjorn@...k.no>,
	netdev@...r.kernel.org, linux-usb@...r.kernel.org,
	Marius Bjørnstad Kotsbak 
	<marius.kotsbak@...il.com>
Subject: Re: [PATCH net] net: qmi_wwan: fix Oops while disconnecting

Am Dienstag, 26. Juni 2012, 09:23:19 schrieb Ming Lei:
> On Mon, Jun 25, 2012 at 8:10 PM, Oliver Neukum <oliver@...kum.org> wrote:

> > At this point a minidriver must not follow the intfdata pointer,
> > because the interface may again be probed. So if here a minidriver
> 
> IMO, probe is serialized strictly with driver unbind since both the parent
> lock and its own device lock have been held, so the probe may only be
> started after driver unbinding is completed.

Yes, but if you have a driver which claims multiple interfaces and uses
a subdriver, then you will have cases of intfdate being NULL before
disconnect() finishes.

> > still uses intfdata, locking will be needed. We want to catch those
> > casees.
> 
> Suppose infdata is used here somewhere, it is surely a bug because
> the usbnet instance pointed by intfdata will be freed soon.

Of course. That is the point.

> So looks putting the set to NULL after driver_info->unbind is good,
> doesn't it?

Again, of course. We could drop it (but not the check for NULL in usbnet).
It is a debugging aid. 

> >        usb_kill_urb(dev->interrupt);
> >        usb_free_urb(dev->interrupt);
> >
> >        free_netdev(net);
> >        usb_put_dev (xdev);
> > }
> >
> >> > Sure, it is a debugging aid. It has the drawback that minidrivers have
> >> > to be able to deal with intfdata being NULL. That is not hard to do.
> >>
> >> The check isn't needed if the set to NULL is put after  driver_info->unbind
> >> in usbnet_disconnect.
> >
> > True, but we don't catch bugs.
> 
> If the check is added, the bugs may be hided, and no stack will be
> dumped, :-)

That is also true.

Bjørn,

do you use subdrivers with cdc-ether?

	Regards
		Oliver

-- 
- - - 
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 
Maxfeldstraße 5                         
90409 Nürnberg 
Germany 
- - - 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ