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]
Date:	Fri, 19 Oct 2012 12:35:31 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Roland Stigge <stigge@...com.de>,
	Greg KH <gregkh@...uxfoundation.org>,
	Grant Likely <grant.likely@...retlab.ca>
Cc:	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/15 v5] gpio: Add sysfs support to block GPIO API

On Thu, Oct 18, 2012 at 12:07 PM, Roland Stigge <stigge@...com.de> wrote:
> On 10/17/2012 09:05 PM, Greg KH wrote:
>>>
>>> +    if (value != exported) {
>>> +            if (value)
>>> +                    status = gpio_block_value_export(block);
>>> +            else
>>> +                    status = gpio_block_value_unexport(block);
>>
>> That looks like a recipie for disaster.  Why do you allow userspace to
>> do this?
>
> Exporting for gpio blocks is done as follows: writing "1" to the
> "exported" _device_ attribute of the gpio block creates the "values"
> attribute and at the same time requests the whole block (including all
> of its gpios) as "sysfs".

To me it reads like Greg's comment is basically pinpointing a flaw
in Brownell's initial design of gpio sysfs: that new sysfs files are
created and destroyed by writing into sysfs */export files from
userspace?

See commit: d8f388d8dc8d4f36539dd37c1fff62cc404ea0fc

The block GPIO stuff is just following that design pattern.

Yours,
Linus Walleij
--
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