diff options
author | David Quigley <dpquigl@tycho.nsa.gov> | 2006-06-23 11:04:02 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 16:42:54 +0200 |
commit | 86c3a7645c05a7d06b72653aa4b2bea4e7229d1b (patch) | |
tree | ac68280e9c44dbc6ca4c88dc1e9c72a8f56be95e /mm/mempolicy.c | |
parent | [PATCH] SELinux: add task_movememory hook (diff) | |
download | linux-86c3a7645c05a7d06b72653aa4b2bea4e7229d1b.tar.xz linux-86c3a7645c05a7d06b72653aa4b2bea4e7229d1b.zip |
[PATCH] SELinux: add security_task_movememory calls to mm code
This patch inserts security_task_movememory hook calls into memory management
code to enable security modules to mediate this operation between tasks.
Since the last posting, the hook has been renamed following feedback from
Christoph Lameter.
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>
Cc: Andi Kleen <ak@muc.de>
Acked-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 05b84acf0bb3..ec4a1a950df9 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -88,6 +88,7 @@ #include <linux/proc_fs.h> #include <linux/migrate.h> #include <linux/rmap.h> +#include <linux/security.h> #include <asm/tlbflush.h> #include <asm/uaccess.h> @@ -942,6 +943,10 @@ asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, goto out; } + err = security_task_movememory(task); + if (err) + goto out; + err = do_migrate_pages(mm, &old, &new, capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE); out: |