Commit b88fb18e7e0e17d517c5267de938c1a35a063a97

Authored by Florian Fainelli
Committed by Ralf Baechle
1 parent a685bc3dab

MIPS: MT: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS=y

When CONFIG_UIDGID_STRICT_TYPE_CHECKS is enabled, plain integer checking
between different uids/gids is explicitely turned into a build failure
by making the k{uid,gid}_t types a structure containing a value:

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')

In order to ensure proper comparison between uids, using the helper
function uid_eq() which performs the right thing whenever this config
option is turned on or off.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Patchwork: https://patchwork.linux-mips.org/patch/4717/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

arch/mips/kernel/mips-mt-fpaff.c
... ... @@ -50,8 +50,8 @@
50 50  
51 51 rcu_read_lock();
52 52 pcred = __task_cred(p);
53   - match = (cred->euid == pcred->euid ||
54   - cred->euid == pcred->uid);
  53 + match = (uid_eq(cred->euid, pcred->euid) ||
  54 + uid_eq(cred->euid, pcred->uid));
55 55 rcu_read_unlock();
56 56 return match;
57 57 }