mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Stephen Smalley <sds@tycho.nsa.gov>,
	Eric Paris <eparis@redhat.com>,
	David Quigley <dpquigl@tycho.nsa.gov>,
	Chris Wright <chrisw@sous-sol.org>,
	Christoph Lameter <clameter@sgi.com>
Subject: [PATCH 2/3] SELinux: add security_task_movememory calls to mm code
Date: Wed, 21 Jun 2006 17:36:00 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606211734480.12872@d.namei> (raw)
In-Reply-To: <Pine.LNX.4.64.0606211730540.12872@d.namei>

From: David Quigley <dpquigl@tycho.nsa.gov>

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.

This patch is aimed at 2.6.18 inclusion.

Please apply.

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>


---

 mm/mempolicy.c |    5 +++++
 mm/migrate.c   |    6 ++++++
 2 files changed, 11 insertions(+)

diff -purN -X dontdiff linux-2.6.17-mm1.p/mm/mempolicy.c linux-2.6.17-mm1.w/mm/mempolicy.c
--- linux-2.6.17-mm1.p/mm/mempolicy.c	2006-06-21 11:54:12.000000000 -0400
+++ linux-2.6.17-mm1.w/mm/mempolicy.c	2006-06-21 17:18:00.000000000 -0400
@@ -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>
@@ -946,6 +947,10 @@ asmlinkage long sys_migrate_pages(pid_t 
 		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:
diff -purN -X dontdiff linux-2.6.17-mm1.p/mm/migrate.c linux-2.6.17-mm1.w/mm/migrate.c
--- linux-2.6.17-mm1.p/mm/migrate.c	2006-06-21 11:54:12.000000000 -0400
+++ linux-2.6.17-mm1.w/mm/migrate.c	2006-06-21 17:17:52.000000000 -0400
@@ -27,6 +27,7 @@
 #include <linux/writeback.h>
 #include <linux/mempolicy.h>
 #include <linux/vmalloc.h>
+#include <linux/security.h>
 
 #include "internal.h"
 
@@ -903,6 +904,11 @@ asmlinkage long sys_move_pages(pid_t pid
 		goto out2;
 	}
 
+ 	err = security_task_movememory(task);
+ 	if (err)
+ 		goto out2;
+ 	
+
 	task_nodes = cpuset_mems_allowed(task);
 
 	/* Limit nr_pages so that the multiplication may not overflow */

  parent reply	other threads:[~2006-06-21 21:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 19:20 [PATCH 1/3] SELinux: Add security hook definitions for setmempolicy James Morris
2006-06-21 19:23 ` [PATCH 2/3] SELinux: add security_task_setmempolicy hooks to mm code James Morris
2006-06-21 19:33   ` Christoph Lameter
2006-06-21 19:51     ` James Morris
2006-06-21 20:07       ` Christoph Lameter
2006-06-21 20:47         ` James Morris
2006-06-21 19:26 ` [PATCH 3/3] SELinux: Add sockcreate node to procattr API James Morris
2006-06-21 21:33 ` [PATCH 0/3] SELinux: movememory & sockcreate updates for -mm James Morris
2006-06-21 21:34   ` [PATCH 1/3] SELinux: add task_movememory hook James Morris
2006-06-22 21:53     ` Chris Wright
2006-06-21 21:36   ` James Morris [this message]
2006-06-21 21:43     ` [PATCH 2/3] SELinux: add security_task_movememory calls to mm code Christoph Lameter
2006-06-21 21:54       ` James Morris
2006-06-22 12:31     ` Serge E. Hallyn
2006-06-22 14:55       ` Christoph Lameter
2006-06-22 19:10       ` James Morris
2006-06-22 19:21       ` Chris Wright
2006-06-22 21:53     ` Chris Wright
2006-06-21 21:37   ` [PATCH 3/3] SELinux: Add sockcreate node to procattr API James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0606211734480.12872@d.namei \
    --to=jmorris@namei.org \
    --cc=akpm@osdl.org \
    --cc=chrisw@sous-sol.org \
    --cc=clameter@sgi.com \
    --cc=dpquigl@tycho.nsa.gov \
    --cc=eparis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®