diff options
author | David Howells <dhowells@redhat.com> | 2008-11-13 18:38:37 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-11-13 18:38:37 -0500 |
commit | b4212737a39e4cfb0fb66769acbc0bd182a93253 (patch) | |
tree | 96a3b7aa0a8d6aa94baaf25204e77254625eab6c /arch | |
parent | ef81ee9855d6c605ed6090a8018c78572cc68b5c (diff) |
CRED: Wrap task credential accesses in the MIPS arch
Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.
Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().
Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kernel/mips-mt-fpaff.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c index dc9eb72ed9de..5e77a3a21f98 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c | |||
@@ -51,6 +51,7 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len, | |||
51 | int retval; | 51 | int retval; |
52 | struct task_struct *p; | 52 | struct task_struct *p; |
53 | struct thread_info *ti; | 53 | struct thread_info *ti; |
54 | uid_t euid; | ||
54 | 55 | ||
55 | if (len < sizeof(new_mask)) | 56 | if (len < sizeof(new_mask)) |
56 | return -EINVAL; | 57 | return -EINVAL; |
@@ -76,9 +77,9 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len, | |||
76 | */ | 77 | */ |
77 | get_task_struct(p); | 78 | get_task_struct(p); |
78 | 79 | ||
80 | euid = current_euid(); | ||
79 | retval = -EPERM; | 81 | retval = -EPERM; |
80 | if ((current->euid != p->euid) && (current->euid != p->uid) && | 82 | if (euid != p->euid && euid != p->uid && !capable(CAP_SYS_NICE)) { |
81 | !capable(CAP_SYS_NICE)) { | ||
82 | read_unlock(&tasklist_lock); | 83 | read_unlock(&tasklist_lock); |
83 | goto out_unlock; | 84 | goto out_unlock; |
84 | } | 85 | } |