random_offset
unsigned long random_offset;
#define RELOCATED_KASLR(x) ((void *)((long)x + random_offset))
random_offset = get_random_boot() << 16;
random_offset &= (CONFIG_RANDOMIZE_BASE_MAX_OFFSET - 1);
if (random_offset < kernel_length)
random_offset += ALIGN(kernel_length, 0xffff);
static inline void __init update_reloc_offset(unsigned long *addr, long random_offset)
unsigned long random_offset = 0;
random_offset = (unsigned long)location_new - (unsigned long)(_text);
if (random_offset) {
reloc_offset += random_offset;
update_reloc_offset(&reloc_offset, random_offset);
relocate_absolute(random_offset);
return random_offset;
static inline void __init relocate_absolute(long random_offset)
unsigned int random_offset = 0;
efi_get_random_bytes(sizeof(random_offset), (u8 *)&random_offset);
random_offset ^= (random_get_entropy() << 16);
random_offset &= (CONFIG_RANDOMIZE_BASE_MAX_OFFSET - 1);
random_offset = ALIGN(random_offset + SZ_64K, SZ_64K);
return PHYSADDR(VMLINUX_LOAD_ADDRESS) + random_offset;
offset = random_offset(start, end,