Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Switch GPIO direction on Raspberry Pi using ioctl()





On Sat, Apr 4, 2015 at 9:06 AM, Marc Balmer <marc%msys.ch@localhost> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am 04.04.15 um 17:19 schrieb Greg Troxel:
>
> Marc Balmer <marc%msys.ch@localhost> writes:
>
>> No, once the securelevel is raised all games are final, the GPIO
>> configuration can not be changed anymore.  That is on purpose.
​>> .....​

>
> What's the rationale for GPIO direction being a security issue, vs
> viewing that as input/output ports?  I can see that hooking up
> some things to gpio might want to be fixed, but that seems like an
> exceptional case, not the norm.    So perhaps controllable should
> be default, with a lockdown ioctl for people who have a security
> reason to tie this to securelevel.
>
> Or perhaps I'm missing some obvious use case that's normal.

With a misconfigured GPIO subsystem you can fry your system (not in
all cases, of course), so the idea is to lay down the GPIO layout
early and make it "read-only".

​Hi Marc, could you please provide some examples of how a misconfigured GPIO can 'fry' a system?

These days, hardware is remarkably robust, compared with the 'olden days'. 
 
Being able to fry a system should be the exception, not the norm.

​I think, frankly, this is a non-unix, non-C approach.

I do unix and C because I know how to skate on thin ice while juggling flaming scimitars.  And I like it that way. (!)  I don't (yet) need the soft cocoon of a Nanny OS.

Consider, also, that this is a $20 'system' - e.g. RPi Model A+   I'm not sure if cost is an architecture concern, but I believe it should be.

​Some simple examples where one needs to frequently change from Input to Output and back is when doing '1-wire' protocols, on  Dallas/Maxim parts; with LIN-based protocols; or OpenSDA's DIO pin.  The list is endless.  And it's becoming more and more common.

-Mike​
 


Home | Main Index | Thread Index | Old Index