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: <20121016174038.GA17982@kroah.com>
Date:	Tue, 16 Oct 2012 10:40:38 -0700
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	Roland Stigge <stigge@...com.de>, grant.likely@...retlab.ca,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	w.sang@...gutronix.de, jbe@...gutronix.de, plagnioj@...osoft.com,
	highguy@...il.com, broonie@...nsource.wolfsonmicro.com,
	daniel-gl@....net, rmallon@...il.com
Subject: Re: [PATCH RFC 02/11 v4] gpio: Add sysfs support to block GPIO API

On Tue, Oct 16, 2012 at 07:27:15PM +0200, Linus Walleij wrote:
> On Tue, Oct 16, 2012 at 6:43 PM, Greg KH <gregkh@...uxfoundation.org> wrote:
> > On Tue, Oct 16, 2012 at 02:53:45PM +0200, Roland Stigge wrote:
> >>
> >> Further, current gpio and gpiochip devices are also doing this way:
> >> creating the device and subsequently their attrs, even though there may
> >> be a better way but I'm still wondering how this would be.
> >
> > Then the existing code is broken and should be fixed to use dev_attrs.
> > I guess it's time to audit the tree and find all places that get this
> > wrong...
> 
> The thing is, as I've tried to explain but maybe didn't get across,
> that these devices don't *have* a parent, and are not part of any
> tree.

You are passing in a parent device to the device_create() call, where
did that pointer come from?

Either way, the attribute creation needs to happen before we announce
the device to userspace, that's a bug that should be fixed now.

> They are parentless mock devices, created on-the-fly just to get
> sysfs entries.

That's fine, well, not the "parentless" part, but that should be trivial
to fix, just pass in the correct pointer and you should be fine.

> What is needed it to get the device model right in the first
> place.

I thought it was in the device model already?

> Fixing it has been drafted by me and Grant:
> https://blueprints.launchpad.net/linux-linaro/+spec/gpiochip-to-dev
> 
> This is not all-encompassing though :-/

That's a good list to work from, good luck :)

greg k-h
--
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