All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sysfs: change permissions for /sys from 0755 to 0555
@ 2011-12-14 15:34 Vitaly Kuznetsov
  2011-12-19  2:32 ` Eric W. Biederman
  2012-01-05  0:17 ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Vitaly Kuznetsov @ 2011-12-14 15:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel

There is a misleading difference between /proc and /sys permissions, 
/proc is 0555 and /sys is 0755. But
as it is impossible to create or unlink something in /sys it would be 
nice to have same permissions.

Signed-off-by: Vitaly Kuznetsov <vitty@altlinux.ru>
---
  fs/sysfs/mount.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 4974995..9d56fdd 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -36,7 +36,7 @@ struct sysfs_dirent sysfs_root = {
         .s_name         = "",
         .s_count        = ATOMIC_INIT(1),
         .s_flags        = SYSFS_DIR,
-       .s_mode         = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
+       .s_mode         = S_IFDIR | S_IRUGO | S_IXUGO,
         .s_ino          = 1,
  };

-- 
1.7.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] sysfs: change permissions for /sys from 0755 to 0555
  2011-12-14 15:34 [PATCH] sysfs: change permissions for /sys from 0755 to 0555 Vitaly Kuznetsov
@ 2011-12-19  2:32 ` Eric W. Biederman
  2011-12-20 12:34   ` Vitaly Kuznetsov
  2012-01-05  0:17 ` Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Eric W. Biederman @ 2011-12-19  2:32 UTC (permalink / raw)
  To: Vitaly Kuznetsov; +Cc: Greg Kroah-Hartman, linux-kernel

Vitaly Kuznetsov <vitty@altlinux.ru> writes:

> There is a misleading difference between /proc and /sys permissions, /proc is
> 0555 and /sys is 0755. But
> as it is impossible to create or unlink something in /sys it would be nice to
> have same permissions.

Where does this difference matter?  This doesn't look like something
that could matter in practice.  If this does matter in practice this
change deserves a comment and a fuller explanation.

The change itself seems reasonable and probably worth making as general
cleanup.

Eric

> Signed-off-by: Vitaly Kuznetsov <vitty@altlinux.ru>
> ---
>  fs/sysfs/mount.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
> index 4974995..9d56fdd 100644
> --- a/fs/sysfs/mount.c
> +++ b/fs/sysfs/mount.c
> @@ -36,7 +36,7 @@ struct sysfs_dirent sysfs_root = {
>         .s_name         = "",
>         .s_count        = ATOMIC_INIT(1),
>         .s_flags        = SYSFS_DIR,
> -       .s_mode         = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
> +       .s_mode         = S_IFDIR | S_IRUGO | S_IXUGO,
>         .s_ino          = 1,
>  };

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sysfs: change permissions for /sys from 0755 to 0555
  2011-12-19  2:32 ` Eric W. Biederman
@ 2011-12-20 12:34   ` Vitaly Kuznetsov
  0 siblings, 0 replies; 5+ messages in thread
From: Vitaly Kuznetsov @ 2011-12-20 12:34 UTC (permalink / raw)
  To: ebiederm; +Cc: Greg Kroah-Hartman, linux-kernel

On Sun, 18 Dec 2011 18:32:18 -0800, ebiederm@xmission.com wrote:
> Vitaly Kuznetsov <vitty@altlinux.ru> writes:
>
>> There is a misleading difference between /proc and /sys permissions, 
>> /proc is
>> 0555 and /sys is 0755. But
>> as it is impossible to create or unlink something in /sys it would 
>> be nice to
>> have same permissions.
>
> Where does this difference matter?  This doesn't look like something
> that could matter in practice.  If this does matter in practice this
> change deserves a comment and a fuller explanation.

This matters only for programs which 'read' permissions instead of 
'testing' them, but it's a challenge to imagine such program.

>
> The change itself seems reasonable and probably worth making as 
> general
> cleanup.
>

Let's consider it cleanup-only. The main idea is: /proc and /sys 
permissions must be the same as they are really the same.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sysfs: change permissions for /sys from 0755 to 0555
  2011-12-14 15:34 [PATCH] sysfs: change permissions for /sys from 0755 to 0555 Vitaly Kuznetsov
  2011-12-19  2:32 ` Eric W. Biederman
@ 2012-01-05  0:17 ` Greg KH
  2012-01-17 12:17   ` Vitaly Kuznetsov
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2012-01-05  0:17 UTC (permalink / raw)
  To: Vitaly Kuznetsov; +Cc: Greg Kroah-Hartman, linux-kernel

On Wed, Dec 14, 2011 at 07:34:50PM +0400, Vitaly Kuznetsov wrote:
> There is a misleading difference between /proc and /sys permissions,
> /proc is 0555 and /sys is 0755. But
> as it is impossible to create or unlink something in /sys it would
> be nice to have same permissions.
> 
> Signed-off-by: Vitaly Kuznetsov <vitty@altlinux.ru>
> ---
>  fs/sysfs/mount.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
> index 4974995..9d56fdd 100644
> --- a/fs/sysfs/mount.c
> +++ b/fs/sysfs/mount.c
> @@ -36,7 +36,7 @@ struct sysfs_dirent sysfs_root = {
>         .s_name         = "",
>         .s_count        = ATOMIC_INIT(1),
>         .s_flags        = SYSFS_DIR,
> -       .s_mode         = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
> +       .s_mode         = S_IFDIR | S_IRUGO | S_IXUGO,
>         .s_ino          = 1,

The tabs are all converted to spaces here, making this impossible to
apply :(


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] sysfs: change permissions for /sys from 0755 to 0555
  2012-01-05  0:17 ` Greg KH
@ 2012-01-17 12:17   ` Vitaly Kuznetsov
  0 siblings, 0 replies; 5+ messages in thread
From: Vitaly Kuznetsov @ 2012-01-17 12:17 UTC (permalink / raw)
  To: Greg KH; +Cc: Greg Kroah-Hartman, linux-kernel

There is a misleading difference between /proc and /sys permissions, /proc is 0555 and /sys is 0755. But
as it is impossible to create or unlink something in /sys it would be nice to have same permissions.

Signed-off-by: Vitaly Kuznetsov <vitty@altlinux.ru>
---
 fs/sysfs/mount.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 4974995..9d56fdd 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -36,7 +36,7 @@ struct sysfs_dirent sysfs_root = {
 	.s_name		= "",
 	.s_count	= ATOMIC_INIT(1),
 	.s_flags	= SYSFS_DIR,
-	.s_mode		= S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
+	.s_mode		= S_IFDIR | S_IRUGO | S_IXUGO,
 	.s_ino		= 1,
 };
 
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-17 12:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14 15:34 [PATCH] sysfs: change permissions for /sys from 0755 to 0555 Vitaly Kuznetsov
2011-12-19  2:32 ` Eric W. Biederman
2011-12-20 12:34   ` Vitaly Kuznetsov
2012-01-05  0:17 ` Greg KH
2012-01-17 12:17   ` Vitaly Kuznetsov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.