• Y
    x86/KASLR: Consolidate mem_avoid[] entries · 9dc1969c
    Yinghai Lu 提交于
    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: NYinghai Lu <yinghai@kernel.org>
    Signed-off-by: NBaoquan He <bhe@redhat.com>
    [ Rwrote changelog, cleaned up code comments. ]
    Signed-off-by: NKees 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.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
    9dc1969c
kaslr.c 11.2 KB