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: <200910131553.58804.david-b@pacbell.net>
Date:	Tue, 13 Oct 2009 15:53:58 -0700
From:	David Brownell <david-b@...bell.net>
To:	Jonathan Corbet <corbet@....net>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2] GPIO: Add gpio_lookup

On Tuesday 13 October 2009, Jonathan Corbet wrote:
> On Tue, 13 Oct 2009 14:10:40 -0700
> David Brownell <david-b@...bell.net> wrote:
> 
> > Not real keen on this; see separate emails, and below.
> 
> OK, so the story I'm getting is that each driver needs to set up its
> own mechanism for obtaining GPIO numbers - it needs to create its own
> lookup mechanism.

Each driver needs its own *configuration* scheme.  Yes;
that's a very standard requirement.  ;)


> That's fine, I can do that; I just thought it made 
> sense to make use of the information that's already there.

It's not necessarily "there" though; or safe to use in this way,
should it happen to be present.


> Andrew, you might as well drop the patch.
> 
> (I'm less worried about the uniqueness side, BTW; it just means drivers
> need to create meaningful names for their GPIOs.)

I don't see how they *can* though ... unless they're dynamically
allocated using a scheme like "combine <this device's sysfs name>
with <token>".  Consider two PCI cards with two different GPIOs
for their "camera_active" LED... "camera_active" is meaningful,
but unusable because it's not unique.


Quick rule of thumb:  in absolutely *ANYTHING* to do with resource
lookup, see how the names/IDs are scoped.  That's the first place
problems show up.  If the scopes are not clearly defined, or there
is nothing to ensure uniqueness within that scope ... trouble.

- Dave


> 
> Thanks,
> 
> jon
> 
> 


--
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