| 1 | From 0714f2ec1e950d7b825093d05ae8eacf1d66ce58 Mon Sep 17 00:00:00 2001 |
| 2 | From: Florian Fainelli <florian@openwrt.org> |
| 3 | Date: Mon, 10 Dec 2012 15:52:07 +0100 |
| 4 | Subject: [PATCH 3.7-rc8] MIPS: MT: fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS=y |
| 5 | |
| 6 | When CONFIG_UIDGID_STRICT_TYPE_CHECKS is enabled, plain integer checking |
| 7 | between different uids/gids is explicitely turned into a build failure |
| 8 | by making the k{uid,gid}_t types a structure containing a value: |
| 9 | |
| 10 | arch/mips/kernel/mips-mt-fpaff.c: In function 'check_same_owner': |
| 11 | arch/mips/kernel/mips-mt-fpaff.c:53:22: error: invalid operands to |
| 12 | binary == (have 'kuid_t' and 'kuid_t') |
| 13 | arch/mips/kernel/mips-mt-fpaff.c:54:15: error: invalid operands to |
| 14 | binary == (have 'kuid_t' and 'kuid_t') |
| 15 | |
| 16 | This problem got introduced with commit 17c04139 (MIPS: MT: Fix FPU affinity.) |
| 17 | |
| 18 | In order to ensure proper comparison between uids, using the helper |
| 19 | function uid_eq() which performs the right thing whenever this config |
| 20 | option is turned on or off. |
| 21 | |
| 22 | Signed-off-by: Florian Fainelli <florian@openwrt.org> |
| 23 | --- |
| 24 | Ralf, 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 | |