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

Commit 2071b3e3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'x86/espfix' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next

Pull x86-64 espfix changes from Peter Anvin:
 "This is the espfix64 code, which fixes the IRET information leak as
  well as the associated functionality problem.  With this code applied,
  16-bit stack segments finally work as intended even on a 64-bit
  kernel.

  Consequently, this patchset also removes the runtime option that we
  added as an interim measure.

  To help the people working on Linux kernels for very small systems,
  this patchset also makes these compile-time configurable features"

* 'x86/espfix' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  Revert "x86-64, modify_ldt: Make support for 16-bit segments a runtime option"
  x86, espfix: Make it possible to disable 16-bit support
  x86, espfix: Make espfix64 a Kconfig option, fix UML
  x86, espfix: Fix broken header guard
  x86, espfix: Move espfix definitions into a separate header file
  x86-32, espfix: Remove filter for espfix32 due to race
  x86-64, espfix: Don't leak bits 31:16 of %esp returning to 16-bit stack
parents 9df0fe64 e6ab9a20
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ ffffc90000000000 - ffffe8ffffffffff (=45 bits) vmalloc/ioremap space
ffffe90000000000 - ffffe9ffffffffff (=40 bits) hole
ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB)
... unused hole ...
ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks
... unused hole ...
ffffffff80000000 - ffffffffa0000000 (=512 MB)  kernel text mapping, from phys 0
ffffffffa0000000 - ffffffffff5fffff (=1525 MB) module mapping space
ffffffffff600000 - ffffffffffdfffff (=8 MB) vsyscalls
+21 −4
Original line number Diff line number Diff line
@@ -912,10 +912,27 @@ config VM86
	default y
	depends on X86_32
	---help---
	  This option is required by programs like DOSEMU to run 16-bit legacy
	  code on X86 processors. It also may be needed by software like
	  XFree86 to initialize some video cards via BIOS. Disabling this
	  option saves about 6k.
	  This option is required by programs like DOSEMU to run
	  16-bit real mode legacy code on x86 processors. It also may
	  be needed by software like XFree86 to initialize some video
	  cards via BIOS. Disabling this option saves about 6K.

config X86_16BIT
	bool "Enable support for 16-bit segments" if EXPERT
	default y
	---help---
	  This option is required by programs like Wine to run 16-bit
	  protected mode legacy code on x86 processors.  Disabling
	  this option saves about 300 bytes on i386, or around 6K text
	  plus 16K runtime memory on x86-64,

config X86_ESPFIX32
	def_bool y
	depends on X86_16BIT && X86_32

config X86_ESPFIX64
	def_bool y
	depends on X86_16BIT && X86_64

config TOSHIBA
	tristate "Toshiba Laptop support"
+16 −0
Original line number Diff line number Diff line
#ifndef _ASM_X86_ESPFIX_H
#define _ASM_X86_ESPFIX_H

#ifdef CONFIG_X86_64

#include <asm/percpu.h>

DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack);
DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr);

extern void init_espfix_bsp(void);
extern void init_espfix_ap(void);

#endif /* CONFIG_X86_64 */

#endif /* _ASM_X86_ESPFIX_H */
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ typedef struct { pteval_t pte; } pte_t;
#define MODULES_VADDR    (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
#define MODULES_END      _AC(0xffffffffff000000, UL)
#define MODULES_LEN   (MODULES_END - MODULES_VADDR)
#define ESPFIX_PGD_ENTRY _AC(-2, UL)
#define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT)

#define EARLY_DYNAMIC_PAGE_TABLES	64

+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ static inline void x86_ce4100_early_setup(void) { }

#ifndef _SETUP

#include <asm/espfix.h>

/*
 * This is set up by the setup-routine at boot-time
 */
Loading