Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5861658 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
 "Misc fixes from all around the place:

   - a KASLR related revert where we ran out of time to get a fix - this
     represents a substantial portion of the diffstat,

   - two FPU fixes,

   - two x86 platform fixes: an ACPI reduced-hw fix and a NumaChip fix,

   - an entry code fix,

   - and a VDSO build fix"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  Revert "x86/mm/ASLR: Propagate base load address calculation"
  x86/fpu: Drop_fpu() should not assume that tsk equals current
  x86/fpu: Avoid math_state_restore() without used_math() in __restore_xstate_sig()
  x86/apic/numachip: Fix sibling map with NumaChip
  x86/platform, acpi: Bypass legacy PIC and PIT in ACPI hardware reduced mode
  x86/asm/entry/32: Fix user_mode() misuses
  x86/vdso: Fix the build on GCC5
parents 13326e5a 69797daf
Loading
Loading
Loading
Loading
+1 −33
Original line number Diff line number Diff line
@@ -14,13 +14,6 @@
static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@"
		LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION;

struct kaslr_setup_data {
	__u64 next;
	__u32 type;
	__u32 len;
	__u8 data[1];
} kaslr_setup_data;

#define I8254_PORT_CONTROL	0x43
#define I8254_PORT_COUNTER0	0x40
#define I8254_CMD_READBACK	0xC0
@@ -302,29 +295,7 @@ static unsigned long find_random_addr(unsigned long minimum,
	return slots_fetch_random();
}

static void add_kaslr_setup_data(struct boot_params *params, __u8 enabled)
{
	struct setup_data *data;

	kaslr_setup_data.type = SETUP_KASLR;
	kaslr_setup_data.len = 1;
	kaslr_setup_data.next = 0;
	kaslr_setup_data.data[0] = enabled;

	data = (struct setup_data *)(unsigned long)params->hdr.setup_data;

	while (data && data->next)
		data = (struct setup_data *)(unsigned long)data->next;

	if (data)
		data->next = (unsigned long)&kaslr_setup_data;
	else
		params->hdr.setup_data = (unsigned long)&kaslr_setup_data;

}

unsigned char *choose_kernel_location(struct boot_params *params,
				      unsigned char *input,
unsigned char *choose_kernel_location(unsigned char *input,
				      unsigned long input_size,
				      unsigned char *output,
				      unsigned long output_size)
@@ -335,17 +306,14 @@ unsigned char *choose_kernel_location(struct boot_params *params,
#ifdef CONFIG_HIBERNATION
	if (!cmdline_find_option_bool("kaslr")) {
		debug_putstr("KASLR disabled by default...\n");
		add_kaslr_setup_data(params, 0);
		goto out;
	}
#else
	if (cmdline_find_option_bool("nokaslr")) {
		debug_putstr("KASLR disabled by cmdline...\n");
		add_kaslr_setup_data(params, 0);
		goto out;
	}
#endif
	add_kaslr_setup_data(params, 1);

	/* Record the various known unsafe memory ranges. */
	mem_avoid_init((unsigned long)input, input_size,
+1 −2
Original line number Diff line number Diff line
@@ -401,8 +401,7 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap,
	 * the entire decompressed kernel plus relocation table, or the
	 * entire decompressed kernel plus .bss and .brk sections.
	 */
	output = choose_kernel_location(real_mode, input_data, input_len,
					output,
	output = choose_kernel_location(input_data, input_len, output,
					output_len > run_size ? output_len
							      : run_size);

+2 −4
Original line number Diff line number Diff line
@@ -57,8 +57,7 @@ int cmdline_find_option_bool(const char *option);

#if CONFIG_RANDOMIZE_BASE
/* aslr.c */
unsigned char *choose_kernel_location(struct boot_params *params,
				      unsigned char *input,
unsigned char *choose_kernel_location(unsigned char *input,
				      unsigned long input_size,
				      unsigned char *output,
				      unsigned long output_size);
@@ -66,8 +65,7 @@ unsigned char *choose_kernel_location(struct boot_params *params,
bool has_cpuflag(int flag);
#else
static inline
unsigned char *choose_kernel_location(struct boot_params *params,
				      unsigned char *input,
unsigned char *choose_kernel_location(unsigned char *input,
				      unsigned long input_size,
				      unsigned char *output,
				      unsigned long output_size)
+1 −1
Original line number Diff line number Diff line
@@ -370,7 +370,7 @@ static inline void drop_fpu(struct task_struct *tsk)
	preempt_disable();
	tsk->thread.fpu_counter = 0;
	__drop_fpu(tsk);
	clear_used_math();
	clear_stopped_child_used_math(tsk);
	preempt_enable();
}

+0 −2
Original line number Diff line number Diff line
@@ -51,8 +51,6 @@ extern int devmem_is_allowed(unsigned long pagenr);
extern unsigned long max_low_pfn_mapped;
extern unsigned long max_pfn_mapped;

extern bool kaslr_enabled;

static inline phys_addr_t get_max_mapped(void)
{
	return (phys_addr_t)max_pfn_mapped << PAGE_SHIFT;
Loading