]> git.karo-electronics.de Git - linux-beck.git/commitdiff
userns: On mips modify check_same_owner to use uid_eq
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 17 Nov 2012 06:12:28 +0000 (22:12 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Mon, 19 Nov 2012 11:05:15 +0000 (03:05 -0800)
The kbuild test robot <fengguang.wu@intel.com> report the following error
when building mips with user namespace support enabled.

All error/warnings:
arch/mips/kernel/mips-mt-fpaff.c: In function 'check_same_owner':
arch/mips/kernel/mips-mt-fpaff.c:53:22: error: invalid operands to binary == (have 'kuid_t' and 'kuid_t')
arch/mips/kernel/mips-mt-fpaff.c:54:15: error: invalid operands to binary == (have 'kuid_t' and 'kuid_t')

Replace "a == b" with uid_eq(a, b) removes this error and allows the
code to work with user namespaces enabled.

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
arch/mips/kernel/mips-mt-fpaff.c

index 33f63bab478a7478ad34733eaa861f3aba01e78b..fd814e08c945da41ad10f0582d7ccd7b7a8ab94f 100644 (file)
@@ -50,8 +50,8 @@ static bool check_same_owner(struct task_struct *p)
 
        rcu_read_lock();
        pcred = __task_cred(p);
-       match = (cred->euid == pcred->euid ||
-                cred->euid == pcred->uid);
+       match = (uid_eq(cred->euid, pcred->euid) ||
+                uid_eq(cred->euid, pcred->uid));
        rcu_read_unlock();
        return match;
 }