• Sam Ravnborg's avatar
    [PATCH] kbuild: fix buffer overflow in modpost · 7670f023
    Sam Ravnborg authored
    Jiri Benc <jbenc@suse.cz> reported that modpost would stop with SIGABRT if
    used with long filepaths.
    The error looked like:
    >   Building modules, stage 2.
    >   MODPOST
    > *** glibc detected *** scripts/mod/modpost: realloc(): invalid next size:
    +0x0809f588 ***
    > [...]
    
    Fix this by allocating at least the required memory + SZ bytes each time.
    Before we sometimes ended up allocating too little memory resuting in the
    glibc detected bug above.  Based on patch originally submitted by: Jiri
    Benc <jbenc@suse.cz>
    Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    7670f023
modpost.c 17.3 KB