aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/misc.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-10-10 20:18:16 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-10-13 06:12:19 -0400
commit82fa9637a2ba285bcc7c5050c73010b2c1b3d803 (patch)
treef9a1ba0cd4670beaa0f5b146a979d9dda0165f1c /arch/x86/boot/compressed/misc.c
parent5bfce5ef55cbe78ee2ee6e97f2e26a8a582008f3 (diff)
x86, kaslr: Select random position from e820 maps
Counts available alignment positions across all e820 maps, and chooses one randomly for the new kernel base address, making sure not to collide with unsafe memory areas. Signed-off-by: Kees Cook <keescook@chromium.org> Link: http://lkml.kernel.org/r/1381450698-28710-5-git-send-email-keescook@chromium.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/boot/compressed/misc.c')
-rw-r--r--arch/x86/boot/compressed/misc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 71387685dc16..196eaf373a06 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -112,14 +112,8 @@ struct boot_params *real_mode; /* Pointer to real-mode data */
112void *memset(void *s, int c, size_t n); 112void *memset(void *s, int c, size_t n);
113void *memcpy(void *dest, const void *src, size_t n); 113void *memcpy(void *dest, const void *src, size_t n);
114 114
115#ifdef CONFIG_X86_64 115memptr free_mem_ptr;
116#define memptr long 116memptr free_mem_end_ptr;
117#else
118#define memptr unsigned
119#endif
120
121static memptr free_mem_ptr;
122static memptr free_mem_end_ptr;
123 117
124static char *vidmem; 118static char *vidmem;
125static int vidport; 119static int vidport;