mirror of https://gitee.com/openkylin/linux.git
userns: Convert the move_pages, and migrate_pages permission checks to use uid_eq
Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
This commit is contained in:
parent
14a590c3f9
commit
b38a86eb19
|
@ -865,8 +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 MIGRATION = n
|
|
||||||
depends on NUMA = n
|
|
||||||
depends on SYSVIPC = n
|
depends on SYSVIPC = n
|
||||||
depends on IMA = n
|
depends on IMA = n
|
||||||
depends on EVM = n
|
depends on EVM = n
|
||||||
|
|
|
@ -1334,8 +1334,8 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
|
||||||
* userid as the target process.
|
* userid as the target process.
|
||||||
*/
|
*/
|
||||||
tcred = __task_cred(task);
|
tcred = __task_cred(task);
|
||||||
if (cred->euid != tcred->suid && cred->euid != tcred->uid &&
|
if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) &&
|
||||||
cred->uid != tcred->suid && cred->uid != tcred->uid &&
|
!uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) &&
|
||||||
!capable(CAP_SYS_NICE)) {
|
!capable(CAP_SYS_NICE)) {
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
err = -EPERM;
|
err = -EPERM;
|
||||||
|
|
|
@ -1371,8 +1371,8 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
|
||||||
* userid as the target process.
|
* userid as the target process.
|
||||||
*/
|
*/
|
||||||
tcred = __task_cred(task);
|
tcred = __task_cred(task);
|
||||||
if (cred->euid != tcred->suid && cred->euid != tcred->uid &&
|
if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) &&
|
||||||
cred->uid != tcred->suid && cred->uid != tcred->uid &&
|
!uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) &&
|
||||||
!capable(CAP_SYS_NICE)) {
|
!capable(CAP_SYS_NICE)) {
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
err = -EPERM;
|
err = -EPERM;
|
||||||
|
|
Loading…
Reference in New Issue