Messages in this thread Patch in this message | | | Date | Mon, 24 Aug 2009 21:53:37 +0400 | From | Cyrill Gorcunov <> | Subject | [rfc -tip 2/4] x86,e820: __e820_add_region -- guard against array overflowed |
| |
Better to be paranoid against unpredicted nr_map modifications.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> --- arch/x86/kernel/e820.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.git/arch/x86/kernel/e820.c ===================================================================== --- linux-2.6.git.orig/arch/x86/kernel/e820.c +++ linux-2.6.git/arch/x86/kernel/e820.c @@ -115,7 +115,7 @@ static void __init __e820_add_region(str { int x = e820x->nr_map; - if (x == ARRAY_SIZE(e820x->map)) { + if (x >= ARRAY_SIZE(e820x->map)) { printk(KERN_ERR "Ooops! Too many entries in the memory map!\n"); return; }
| |