lkml.org 
[lkml]   [2009]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    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;
    }


    \
     
     \ /
      Last update: 2009-08-24 19:59    [W:6.317 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site