/[linux-patches]/genpatches-2.6/trunk/2.6.14/1447_15.5_sys_mbind-sanity-checking.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1447_15.5_sys_mbind-sanity-checking.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations) (download) (as text)
Tue Mar 14 13:34:17 2006 UTC (14 years, 7 months ago) by johnm
File MIME type: text/x-diff
File size: 1088 byte(s)
2.6.14-11, rebase against local tree
1 Re-diffed for 2.6.14.7 by Kerin Millar <kerframil@gmail.com>:
2
3 From: Chris Wright <chrisw@sous-sol.org>
4 Date: Fri, 17 Feb 2006 21:59:36 +0000 (-0800)
5 Subject: [PATCH] sys_mbind sanity checking
6 X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/chrisw/linux-2.6.15.y.git;a=commitdiff;h=99e1baf86ff6a31330ff0c7bb77110338f03ddc5
7
8 [PATCH] sys_mbind sanity checking
9
10 Make sure maxnodes is safe size before calculating nlongs in
11 get_nodes().
12
13 Signed-off-by: Chris Wright <chrisw@sous-sol.org>
14 Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 [chrisw: fix units, pointed out by Andi]
16 Cc: Andi Kleen <ak@suse.de>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 ---
19
20 --- linux-2.6.14.7.orig/mm/mempolicy.c 2005-10-27 19:02:08.000000000 -0500
21 +++ linux-2.6.14.7/mm/mempolicy.c 2006-03-08 03:01:55.000000000 -0500
22 @@ -139,6 +139,8 @@ static int get_nodes(unsigned long *node
23 bitmap_zero(nodes, MAX_NUMNODES);
24 if (maxnode == 0 || !nmask)
25 return 0;
26 + if (maxnode > PAGE_SIZE*BITS_PER_BYTE)
27 + return -EINVAL;
28
29 nlongs = BITS_TO_LONGS(maxnode);
30 if ((maxnode % BITS_PER_LONG) == 0)

  ViewVC Help
Powered by ViewVC 1.1.20