From: Eric W. Biederman Date: Tue, 14 Feb 2012 02:02:50 +0000 (-0800) Subject: userns: Convert sysctl permission checks to use kuid and kgids. X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=091bd3ea4e7ff4da8509978b9be93dc9d8cf0680;p=linux-edison.git userns: Convert sysctl permission checks to use kuid and kgids. Acked-by: Serge Hallyn Signed-off-by: Eric W. Biederman --- diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 21d836f4029..3476bca8f7a 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -371,9 +371,9 @@ void register_sysctl_root(struct ctl_table_root *root) static int test_perm(int mode, int op) { - if (!current_euid()) + if (uid_eq(current_euid(), GLOBAL_ROOT_UID)) mode >>= 6; - else if (in_egroup_p(0)) + else if (in_egroup_p(GLOBAL_ROOT_GID)) mode >>= 3; if ((op & ~mode & (MAY_READ|MAY_WRITE|MAY_EXEC)) == 0) return 0; diff --git a/init/Kconfig b/init/Kconfig index 7bebe91367c..be587651b95 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -948,7 +948,6 @@ config UIDGID_CONVERTED depends on NTFS_FS = n depends on OCFS2_FS = n depends on OMFS_FS = n - depends on PROC_SYSCTL = n depends on QNX4FS_FS = n depends on QNX6FS_FS = n depends on REISERFS_FS = n