Root/target/linux/generic/patches-3.7/067-mips_mt_fix_uidgid_strict_type_check.patch

1From 0714f2ec1e950d7b825093d05ae8eacf1d66ce58 Mon Sep 17 00:00:00 2001
2From: Florian Fainelli <florian@openwrt.org>
3Date: Mon, 10 Dec 2012 15:52:07 +0100
4Subject: [PATCH 3.7-rc8] MIPS: MT: fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS=y
5
6When CONFIG_UIDGID_STRICT_TYPE_CHECKS is enabled, plain integer checking
7between different uids/gids is explicitely turned into a build failure
8by making the k{uid,gid}_t types a structure containing a value:
9
10arch/mips/kernel/mips-mt-fpaff.c: In function 'check_same_owner':
11arch/mips/kernel/mips-mt-fpaff.c:53:22: error: invalid operands to
12binary == (have 'kuid_t' and 'kuid_t')
13arch/mips/kernel/mips-mt-fpaff.c:54:15: error: invalid operands to
14binary == (have 'kuid_t' and 'kuid_t')
15
16This problem got introduced with commit 17c04139 (MIPS: MT: Fix FPU affinity.)
17
18In order to ensure proper comparison between uids, using the helper
19function uid_eq() which performs the right thing whenever this config
20option is turned on or off.
21
22Signed-off-by: Florian Fainelli <florian@openwrt.org>
23---
24Ralf, I think you might want to sneak this into 3.7-rc8 if possible at all.
25
26 arch/mips/kernel/mips-mt-fpaff.c | 4 ++--
27 1 file changed, 2 insertions(+), 2 deletions(-)
28
29--- a/arch/mips/kernel/mips-mt-fpaff.c
30+++ b/arch/mips/kernel/mips-mt-fpaff.c
31@@ -50,8 +50,8 @@ static bool check_same_owner(struct task
32 
33     rcu_read_lock();
34     pcred = __task_cred(p);
35- match = (cred->euid == pcred->euid ||
36- cred->euid == pcred->uid);
37+ match = (uid_eq(cred->euid, pcred->euid) ||
38+ uid_eq(cred->euid, pcred->uid));
39     rcu_read_unlock();
40     return match;
41 }
42

Archive Download this file



interactive