aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/mips-mt.c
diff options
context:
space:
mode:
authorDavid Quigley <dpquigl@tycho.nsa.gov>2006-06-28 09:36:46 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-02-06 11:53:21 -0500
commit7418cb89af6f9e21660d60a4bd088a8b6fd11e81 (patch)
tree25f3f1a8a48f297c60b9fd696b2e8a0a2c3d1aa5 /arch/mips/kernel/mips-mt.c
parentc9170617510059c750cb91207b08f35001571a22 (diff)
[MIPS] SELinux: Add security hooks to mips-mt {get,set}affinity
This patch adds LSM hooks into the setaffinity and getaffinity functions for the mips architecture to enable security modules to control these operations between tasks with different security attributes. This implementation uses the existing task_setscheduler and task_getscheduler LSM hooks. Signed-Off-By: David Quigley <dpquigl@tycho.nsa.gov> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: James Morris <jmorris@namei.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/mips-mt.c')
-rw-r--r--arch/mips/kernel/mips-mt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/mips/kernel/mips-mt.c b/arch/mips/kernel/mips-mt.c
index c1373a6e668b..a32f6797353a 100644
--- a/arch/mips/kernel/mips-mt.c
+++ b/arch/mips/kernel/mips-mt.c
@@ -96,6 +96,10 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
96 goto out_unlock; 96 goto out_unlock;
97 } 97 }
98 98
99 retval = security_task_setscheduler(p, 0, NULL);
100 if (retval)
101 goto out_unlock;
102
99 /* Record new user-specified CPU set for future reference */ 103 /* Record new user-specified CPU set for future reference */
100 p->thread.user_cpus_allowed = new_mask; 104 p->thread.user_cpus_allowed = new_mask;
101 105
@@ -141,8 +145,9 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len,
141 p = find_process_by_pid(pid); 145 p = find_process_by_pid(pid);
142 if (!p) 146 if (!p)
143 goto out_unlock; 147 goto out_unlock;
144 148 retval = security_task_getscheduler(p);
145 retval = 0; 149 if (retval)
150 goto out_unlock;
146 151
147 cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map); 152 cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map);
148 153