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, 07 Dec 2012 18:33:28 +0100
From:	Roland Stigge <stigge@...com.de>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
CC:	gregkh@...uxfoundation.org, grant.likely@...retlab.ca,
	linus.walleij@...aro.org, 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, tru@...k-microwave.de, sr@...x.de,
	wg@...ndegger.com
Subject: Re: [PATCH 0/6 v10] gpio: Add block GPIO

On 12/07/2012 06:02 PM, Alan Cox wrote:
>>>> Currently we can set different permissions on different GPIO lines. Your
>>>> driver change drives a truck through this facility.
>>
>> What I maybe misread in your concern: The dev interface is actually an
>> "alternative to sysfs for block GPIO", not considered as a replacement
>> for the current sysfs interface for _single_ GPIOs.
> 
> That is the problem. If you add the driver then you can no longer
> implement the same permissions per node. If I've got a typical hardened
> embedded device running something like SMACK I can tie a few gpio lines
> to specific tasks in the security model.
> 
> The moment there is another driver anyone who can open that driver can
> bypass all the security rules being imposed.
> 
> The basic problem is that right now our mapping is
> 
> "gpio line is a file system object"
> 
> you change it to
> 
> "all gpio lines are a single file system object"

No - maybe that's still not documented well enough: Upon defining a GPIO
block, you can specify each individual GPIO that's contained therein.
Define as many (disjoint) blocks as you want with as many permission
sets as you want, right away.

In the extreme case, define blocks with only a single GPIO in each of
them, and the interface should still be faster than the sysfs one. Each
block is a separate device node with separate permissions.

Further, block GPIOs only need to be present on systems where firmware
tells via DT (or the kernel itself in setup code) explicitely which
GPIOs should be in a certain block to be accessed efficiently.

Sysfs can still work as expected, at least for the remaining GPIOs.

So I don't see a contradiction here, considering that you can still
organize permissions for the (optional) GPIO block, as you do currently
via sysfs.

You can also compare sysfs and block GPIO interfaces to block devices
where you create file systems on top. Userspace can access both, but
it's not very useful to access the underlying block device at the same
time when it's also mounted as an fs. The good thing about the sysfs and
block GPIO case is that you can use both at the same time: Consider a
single controller/gpio_chip containing 32 lines. You can define a GPIO
block of 16 of them for use as an efficient 16 bit bus, and use the rest
via single GPIO sysfs as you described.

Thanks for considering,

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