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: <Pine.LNX.4.44L0.1205071740420.23176-100000@netrider.rowland.org>
Date:	Mon, 7 May 2012 17:51:52 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Tejun Heo <tj@...nel.org>
cc:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: Lockdep false positive in sysfs

On Mon, 7 May 2012, Tejun Heo wrote:

> Hello, Alan.

Hi.

> On Fri, May 04, 2012 at 03:08:53PM -0400, Alan Stern wrote:
> > @@ -588,10 +591,15 @@ static ssize_t usb_dev_authorized_store(
> >  	result = sscanf(buf, "%u\n", &val);
> >  	if (result != 1)
> >  		result = -EINVAL;
> > -	else if (val == 0)
> > +	else if (val == 0) {
> > +		void *cookie;
> > +
> > +		cookie = device_start_attribute_infanticide(dev, attr, NULL);
> >  		result = usb_deauthorize_device(usb_dev);
> > -	else
> > +		device_end_attribute_infanticide(cookie);
> > +	} else {
> >  		result = usb_authorize_device(usb_dev);
> > +	}
> 
> I *think* it looks way too huge as lockdep workaround.  We're adding a

Well, it's not _terribly_ huge.  As far as the driver is concerned, 
it's just a start and an end call.  The lookup interface isn't even 
EXPORTed, because its only user is the device core.

> whole separate lookup interface for this.  If looking up afterwards is
> difficult, can't we get away with adding a field in struct attribute?

You mean, an "ignore this attribute for lockdep purposes" flag?  Yes, 
that would work just as well.

I guess in the end it's a question of balance.  Which has more 
overhead, adding a few function calls here and there, or adding a new 
flags field to every struct attribute?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ