提交 14a590c3 编写于 作者: E Eric W. Biederman

userns: Convert cgroup permission checks to use uid_eq

Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
上级 8751e039
...@@ -865,7 +865,6 @@ config UIDGID_CONVERTED ...@@ -865,7 +865,6 @@ config UIDGID_CONVERTED
# List of kernel pieces that need user namespace work # List of kernel pieces that need user namespace work
# Features # Features
depends on CGROUPS = n
depends on MIGRATION = n depends on MIGRATION = n
depends on NUMA = n depends on NUMA = n
depends on SYSVIPC = n depends on SYSVIPC = n
......
...@@ -2160,9 +2160,9 @@ static int attach_task_by_pid(struct cgroup *cgrp, u64 pid, bool threadgroup) ...@@ -2160,9 +2160,9 @@ static int attach_task_by_pid(struct cgroup *cgrp, u64 pid, bool threadgroup)
* only need to check permissions on one of them. * only need to check permissions on one of them.
*/ */
tcred = __task_cred(tsk); tcred = __task_cred(tsk);
if (cred->euid && if (!uid_eq(cred->euid, GLOBAL_ROOT_UID) &&
cred->euid != tcred->uid && !uid_eq(cred->euid, tcred->uid) &&
cred->euid != tcred->suid) { !uid_eq(cred->euid, tcred->suid)) {
rcu_read_unlock(); rcu_read_unlock();
ret = -EACCES; ret = -EACCES;
goto out_unlock_cgroup; goto out_unlock_cgroup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册