/[linux-patches]/genpatches-2.6/trunk/2.6.14/1710_set-mempolicy-dos.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1710_set-mempolicy-dos.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 292 - (show annotations) (download) (as text)
Tue Jan 31 21:50:53 2006 UTC (14 years, 9 months ago) by johnm
File MIME type: text/x-diff
File size: 1174 byte(s)
Large update - thanks goes to Kerin Millar for the legwork.
1 This patch is a backport of the following patch from the 2.6.15 branch
2 for 2.6.14 by Tim Yamin (plasmaroo@gentoo.org). See gentoo bug #117855.
3
4 ---
5 X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f493d797bc1fe470377adc9d8775845427e240e
6
7 [PATCH] Make sure interleave masks have at least one node set
8
9 Otherwise a bad mem policy system call can confuse the interleaving
10 code into referencing undefined nodes.
11
12 Originally reported by Doug Chapman
13
14 I was told it's CVE-2005-3358
15 (one has to love these security people - they make everything sound important)
16
17 Signed-off-by: Andi Kleen <ak@suse.de>
18 Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19
20 --- linux-2.6.14.orig/mm/mempolicy.c 2005-10-28 01:02:08.000000000 +0100
21 +++ linux-2.6.14/mm/mempolicy.c 2006-01-10 21:37:14.000000000 +0000
22 @@ -219,6 +219,10 @@
23 switch (mode) {
24 case MPOL_INTERLEAVE:
25 bitmap_copy(policy->v.nodes, nodes, MAX_NUMNODES);
26 + if (bitmap_weight(nodes, MAX_NUMNODES) == 0) {
27 + kmem_cache_free(policy_cache, policy);
28 + return ERR_PTR(-EINVAL);
29 + }
30 break;
31 case MPOL_PREFERRED:
32 policy->v.preferred_node = find_first_bit(nodes, MAX_NUMNODES);

  ViewVC Help
Powered by ViewVC 1.1.20