Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7418cb89af6f9e21660d60a4bd088a8b6fd11e81
Commit:     7418cb89af6f9e21660d60a4bd088a8b6fd11e81
Parent:     c9170617510059c750cb91207b08f35001571a22
Author:     David Quigley <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 28 09:36:46 2006 -0400
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Tue Feb 6 16:53:21 2007 +0000

    [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 <[EMAIL PROTECTED]>
    Acked-by:  Stephen Smalley <[EMAIL PROTECTED]>
    Signed-off-by: James Morris <[EMAIL PROTECTED]>
    Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/kernel/mips-mt.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/mips-mt.c b/arch/mips/kernel/mips-mt.c
index c1373a6..a32f679 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,
                goto out_unlock;
        }
 
+       retval = security_task_setscheduler(p, 0, NULL);
+       if (retval)
+               goto out_unlock;
+
        /* Record new user-specified CPU set for future reference */
        p->thread.user_cpus_allowed = new_mask;
 
@@ -141,8 +145,9 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, 
unsigned int len,
        p = find_process_by_pid(pid);
        if (!p)
                goto out_unlock;
-
-       retval = 0;
+       retval = security_task_getscheduler(p);
+       if (retval)
+               goto out_unlock;
 
        cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to