Skip to content
  • Yinghai Lu's avatar
    x86/KASLR: Consolidate mem_avoid[] entries · 9dc1969c
    Yinghai Lu authored
    
    
    The mem_avoid[] array is used to track positions that should be avoided (like
    the compressed kernel, decompression code, etc) when selecting a memory
    position for the randomly relocated kernel. Since ZO is now at the end of
    the decompression buffer and the decompression code (and its heap and
    stack) are at the front, we can safely consolidate the decompression entry,
    the heap entry, and the stack entry. The boot_params memory, however, could
    be elsewhere, so it should be explicitly included.
    
    Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
    Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
    [ Rwrote changelog, cleaned up code comments. ]
    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: kernel-hardening@lists.openwall.com
    Cc: lasse.collin@tukaani.org
    Link: http://lkml.kernel.org/r/1462486436-3707-3-git-send-email-keescook@chromium.org
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    9dc1969c