]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
x86/speculation/mds: Add mds_clear_cpu_buffers()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 18 Feb 2019 22:13:06 +0000 (23:13 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 6 May 2019 16:58:12 +0000 (18:58 +0200)
commit4446d382e1ed845ddc89c893bbbeb4740d9ebbef
tree8e2196037eed6e37d570f3e458437417d20ebc37
parent138de5e33d35c3b9d6b0315064cdee1506d64211
x86/speculation/mds: Add mds_clear_cpu_buffers()

The Microarchitectural Data Sampling (MDS) vulernabilities are mitigated by
clearing the affected CPU buffers. The mechanism for clearing the buffers
uses the unused and obsolete VERW instruction in combination with a
microcode update which triggers a CPU buffer clear when VERW is executed.

Provide a inline function with the assembly magic. The argument of the VERW
instruction must be a memory operand as documented:

  "MD_CLEAR enumerates that the memory-operand variant of VERW (for
   example, VERW m16) has been extended to also overwrite buffers affected
   by MDS. This buffer overwriting functionality is not guaranteed for the
   register operand variant of VERW."

Documentation also recommends to use a writable data segment selector:

  "The buffer overwriting occurs regardless of the result of the VERW
   permission check, as well as when the selector is null or causes a
   descriptor load segment violation. However, for lowest latency we
   recommend using a selector that indicates a valid writable data
   segment."

Add x86 specific documentation about MDS and the internal workings of the
mitigation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
CVE-2018-12126
CVE-2018-12127
CVE-2018-12130

(cherry picked from commit 96ea82f6839ef16812729b3820feb25f293abf63)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Documentation/index.rst
Documentation/x86/conf.py [new file with mode: 0644]
Documentation/x86/index.rst [new file with mode: 0644]
Documentation/x86/mds.rst [new file with mode: 0644]
arch/x86/include/asm/nospec-branch.h