You are not logged in.

#1 2012-06-16 06:12:37

Registered: 2011-09-05
Posts: 6

/sys permissions now 555?

I read this in the latest news post:

Lastly, on upgrading filesystem users of kernels prior to linux-3.4 will get a warning about permissions on /sys. This is nothing to worry about, as of linux-3.4 the permissions will be 555, and this upgrade reflects this in the filesystem package.

...huh? I tried Googling this but came up empty-handed. Even the kernel changelog didn't mention sysfs much, and nothing about changing the permissions (unless I just missed it somehow). Is this an Arch-specific change?

While writing this post I realized that my initial alarm was unwarranted: at first I thought that meant I couldn't write to anything in /sys. In a supreme fit of silliness, I even tried

sudo echo -n mem > /sys/power/state

and interpreted the subsequent "Permission denied" as proof that something was horribly wrong. But of course starting with

sudo -i

fixed that, and my fears were alleviated. Turns out sysfs is still mounted rw and all the usual files are still 644.

So now that I think about it having /sys be 555 is kind of obvious. Now I'm rather bewildered as to why the directories inside sysfs are 755! Under what circumstances would userspace create, delete or rename a file inside the sysfs? I'm by no means a Linux programmer (I'm an EE currently working on programming a microcontroller), so I'll bet I'm missing something obvious, but I'm curious what it is.


#2 2012-06-16 07:36:12

Supreme Leader
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,707

Re: /sys permissions now 555?

The permissions of /sys are set by the kernel.  From 3.4 onwards, they are set to 555.


#3 2012-06-16 12:30:58

From: France
Registered: 2010-05-28
Posts: 661


#4 2012-06-16 12:47:01

Registered: 2011-09-05
Posts: 6

Re: /sys permissions now 555?

Thanks for finding the commit. Sounds like they just did it for consistency with /proc, and probably no one should be creating or deleting anything in there anyway. Curiosity sated smile


Board footer

Powered by FluxBB