[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1247191604.2572.3.camel@myhost>
Date: Fri, 10 Jul 2009 10:06:44 +0800
From: "Figo.zhang" <figo1802@...il.com>
To: Andrew Morton <akpm@...l.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: lkml <linux-kernel@...r.kernel.org>, Tejun Heo <tj@...nel.org>,
Ingo Molnar <mingo@...e.hu>
Subject: [PATCH] vmalloc.c: fix lose num_physpages checking
__get_vm_area_node() lose size (physpages limit) checking, it be called by
__get_vm_area() that some drivers called it directly.
Signed-off-by: Figo.zhang <figo1802@...il.com>
---
mm/vmalloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index f8189a4..99f3aea 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1144,7 +1144,7 @@ static struct vm_struct *__get_vm_area_node(unsigned long size,
}
size = PAGE_ALIGN(size);
- if (unlikely(!size))
+ if (unlikely(!size || (size >> PAGE_SHIFT) > num_physpages))
return NULL;
area = kmalloc_node(sizeof(*area), gfp_mask & GFP_RECLAIM_MASK, node);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists