• Baoquan He's avatar
    x86/KASLR: Handle kernel relocations above 2G correctly · 6f9af75f
    Baoquan He authored
    When processing the relocation table, the offset used to calculate the
    relocation is an 'int'. This is sufficient for calculating the physical
    address of the relocs entry on 32-bit systems and on 64-bit systems when
    the relocation is under 2G.
    
    To handle relocations above 2G (seen in situations like kexec, netboot, etc),
    this offset needs to be calculated using a 'long' to avoid wrapping and
    miscalculating the relocation.
    Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
    [ Rewrote the changelog. ]
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Andy Lutomirski <luto@amacapital.net>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Brian Gerst <brgerst@gmail.com>
    Cc: Dave Young <dyoung@redhat.com>
    Cc: Denys Vlasenko <dvlasenk@redhat.com>
    Cc: H. Peter Anvin <hpa@zytor.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Vivek Goyal <vgoyal@redhat.com>
    Cc: Yinghai Lu <yinghai@kernel.org>
    Cc: lasse.collin@tukaani.org
    Link: http://lkml.kernel.org/r/1461888548-32439-2-git-send-email-keescook@chromium.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    6f9af75f
misc.c 9.57 KB