]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add sys_set_mempolicy patch, fwd from akpm.
authorChris Wright <chrisw@osdl.org>
Fri, 5 Aug 2005 07:15:52 +0000 (00:15 -0700)
committerChris Wright <chrisw@osdl.org>
Fri, 5 Aug 2005 07:15:52 +0000 (00:15 -0700)
queue/series [new file with mode: 0644]
queue/sys_set_mempolicy-mode-check.patch [new file with mode: 0644]

diff --git a/queue/series b/queue/series
new file mode 100644 (file)
index 0000000..39e2b8a
--- /dev/null
@@ -0,0 +1 @@
+sys_set_mempolicy-mode-check.patch
diff --git a/queue/sys_set_mempolicy-mode-check.patch b/queue/sys_set_mempolicy-mode-check.patch
new file mode 100644 (file)
index 0000000..04d95ae
--- /dev/null
@@ -0,0 +1,37 @@
+From stable-bounces@linux.kernel.org  Wed Aug  3 18:45:03 2005
+Date: Wed, 3 Aug 2005 18:43:22 -0700
+From: Andrew Morton <akpm@osdl.org>
+To: stable@kernel.org
+Subject: [PATCH] sys_set_mempolicy() doesnt check if mode < 0
+
+From: Eric Dumazet <dada1@cosmosbay.com>
+
+[PATCH] sys_set_mempolicy() doesnt check if mode < 0
+
+A kernel BUG() is triggered by a call to set_mempolicy() with a negative
+first argument.  This is because the mode is declared as an int, and the
+validity check doesnt check < 0 values.  Alternatively, mode could be
+declared as unsigned int or unsigned long.
+
+Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
+Cc: Andi Kleen <ak@suse.de>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+ mm/mempolicy.c |    2 +-
+ 1 files changed, 1 insertion(+), 1 deletion(-)
+
+Index: linux-2.6.12.y/mm/mempolicy.c
+===================================================================
+--- linux-2.6.12.y.orig/mm/mempolicy.c
++++ linux-2.6.12.y/mm/mempolicy.c
+@@ -409,7 +409,7 @@ asmlinkage long sys_set_mempolicy(int mo
+       struct mempolicy *new;
+       DECLARE_BITMAP(nodes, MAX_NUMNODES);
+-      if (mode > MPOL_MAX)
++      if (mode < 0 || mode > MPOL_MAX)
+               return -EINVAL;
+       err = get_nodes(nodes, nmask, maxnode, mode);
+       if (err)