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: <20120731144724.5ef139fa@notabene.brown>
Date:	Tue, 31 Jul 2012 14:47:24 +1000
From:	NeilBrown <neilb@...e.de>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	linux-kernel@...r.kernel.org,
	Grant Likely <grant.likely@...retlab.ca>
Subject: Re: [GIT PULL] GPIO changes for v3.6

On Mon, 30 Jul 2012 14:36:15 +0100 Mark Brown
<broonie@...nsource.wolfsonmicro.com> wrote:

> On Mon, Jul 30, 2012 at 04:57:33PM +1000, NeilBrown wrote:
> 
> > it means that if !gpio_is_valid(gpio), the error returned is EPROBE_DEFER 
> > which isn't right (an invalid gpio number will never become valid).
> > If a driver happened to use gpio_request to check the validity of the gpio
> > rather than doing it itself, it would defer the probe, rather than assume
> > that the GPIO doesn't exist.
> 
> Is anything actually doing this?  For positive numbers that just seems
> like it's asking for things to explode, for negative numbers I guess you
> can get away with it at the minute though it's obviously not awesome
> error handling.

I suspect not, but stranger things have happened.

... though it occurs to me that it is possible that the GPIO number might not
be allocated until something else has been probed, so a -ve gpio number could
mean "there is no such gpio" or it could mean "gpio has not been allocated
yet".  I wonder if that should be allowed and where it should be handled.

> 
> > I would suggest the following.  Reasonable?
> 
> TBH I'd actually expect that gpio_is_valid() were checking that there's
> a gpio_chip behind the GPIO number, now I look at the implementation
> it's very surprising to me that it's just checking the GPIO array bounds
> (and also that we remove the need for the fixed size GPIO array which is
> just an endless source of annoyance).

Yes, gpio_is_valid is really just a check that the gpio_desc array dereference
won't over-flow.

I'd really like to see gpios be requested by name ... anyone know if there
are any plans along that line?

NeilBrown

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ