linux/debian/patches-debian/mempolicy-check-mode.patch

34 lines
1.1 KiB
Diff

diff -Naru a/mm/mempolicy.c b/mm/mempolicy.c
--- a/mm/mempolicy.c 2005-09-27 13:25:44 -07:00
+++ b/mm/mempolicy.c 2005-09-27 13:25:44 -07:00
@@ -443,7 +443,7 @@
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)
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2005/08/01 21:38:00-07:00 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>
#
# GIT: ba17101b41977f124948e0a7797fdcbb59e19f3e
#
# mm/mempolicy.c
# 2005/08/01 21:38:00-07:00 dada1@cosmosbay.com +1 -1
#