diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-02-13 21:02:50 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-15 17:59:28 -0400 |
commit | 091bd3ea4e7ff4da8509978b9be93dc9d8cf0680 (patch) | |
tree | 0f7eb15899232f24bd1432c5893f96c9ade788bc | |
parent | dcb0f22282e680ee5202ab7574ce78beb3803a9f (diff) |
userns: Convert sysctl permission checks to use kuid and kgids.
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
-rw-r--r-- | fs/proc/proc_sysctl.c | 4 | ||||
-rw-r--r-- | init/Kconfig | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 21d836f40292..3476bca8f7af 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) | |||
371 | 371 | ||
372 | static int test_perm(int mode, int op) | 372 | static int test_perm(int mode, int op) |
373 | { | 373 | { |
374 | if (!current_euid()) | 374 | if (uid_eq(current_euid(), GLOBAL_ROOT_UID)) |
375 | mode >>= 6; | 375 | mode >>= 6; |
376 | else if (in_egroup_p(0)) | 376 | else if (in_egroup_p(GLOBAL_ROOT_GID)) |
377 | mode >>= 3; | 377 | mode >>= 3; |
378 | if ((op & ~mode & (MAY_READ|MAY_WRITE|MAY_EXEC)) == 0) | 378 | if ((op & ~mode & (MAY_READ|MAY_WRITE|MAY_EXEC)) == 0) |
379 | return 0; | 379 | return 0; |
diff --git a/init/Kconfig b/init/Kconfig index 7bebe91367c5..be587651b952 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -948,7 +948,6 @@ config UIDGID_CONVERTED | |||
948 | depends on NTFS_FS = n | 948 | depends on NTFS_FS = n |
949 | depends on OCFS2_FS = n | 949 | depends on OCFS2_FS = n |
950 | depends on OMFS_FS = n | 950 | depends on OMFS_FS = n |
951 | depends on PROC_SYSCTL = n | ||
952 | depends on QNX4FS_FS = n | 951 | depends on QNX4FS_FS = n |
953 | depends on QNX6FS_FS = n | 952 | depends on QNX6FS_FS = n |
954 | depends on REISERFS_FS = n | 953 | depends on REISERFS_FS = n |