On Fri, Mar 13, 2015 at 12:01 PM, Radoslaw Kujawa
<radoslaw.kujawa%c0ff33.net@localhost> wrote:
It's a totally terrible idea to access low level SoC registers from within user-space program. DON'T do that. It's a bad design and completely unsecure. As Michael mentioned, the default securelevel setting prevents this (for a good reason).
If you want to utilise GPIO, then investigate the kernel API we are providing for this (see gpio(4) man page). Patch your program to use it instead of /dev/mem!
I get your point about security concerns, you are right, I am now running at securitylevel = 1, which disallows access to /dev/mem. I will take my time to go through gpio(4), but for now I really don't have time and I would like to do a quick test with my RPi running at securitylevel=0. I have been struggling so far to prevent rc or init to raise the securitylevel from 0 to 1, it seems I can't see where it happens, I have patched /etc/rc/d/securelevel so that it doesn't raise it, I have set the securelevel to 0 in /etc/rc.conf, but amazingly for some reason it gets to 1 maybe after /etc/rc.d/securelevel changes it to 0, so I don't really know what brings the securitylevel up to the value 1.
I _know_ it's very bad, and I don't overlook your advice, but could you please help me understand what is in the way?