Skip to content

Commit

Permalink
userns: On mips modify check_same_owner to use uid_eq
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric W. Biederman committed Nov 19, 2012
1 parent 038e733 commit dd34ad3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/mips/kernel/mips-mt-fpaff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dd34ad3

Please sign in to comment.