Merge tag 'rfds-for-linus-2024-03-11' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Mar 2024 16:31:39 +0000 (09:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Mar 2024 16:31:39 +0000 (09:31 -0700)
Pull x86 RFDS mitigation from Dave Hansen:
 "RFDS is a CPU vulnerability that may allow a malicious userspace to
  infer stale register values from kernel space. Kernel registers can
  have all kinds of secrets in them so the mitigation is basically to
  wait until the kernel is about to return to userspace and has user
  values in the registers. At that point there is little chance of
  kernel secrets ending up in the registers and the microarchitectural
  state can be cleared.

  This leverages some recent robustness fixes for the existing MDS
  vulnerability. Both MDS and RFDS use the VERW instruction for
  mitigation"

* tag 'rfds-for-linus-2024-03-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  KVM/x86: Export RFDS_NO and RFDS_CLEAR to guests
  x86/rfds: Mitigate Register File Data Sampling (RFDS)
  Documentation/hw-vuln: Add documentation for RFDS
  x86/mmio: Disable KVM mitigation when X86_FEATURE_CLEAR_CPU_BUF is set

1  2 
Documentation/admin-guide/kernel-parameters.txt
arch/x86/Kconfig
arch/x86/include/asm/cpufeatures.h
arch/x86/include/asm/msr-index.h
arch/x86/kernel/cpu/bugs.c
arch/x86/kernel/cpu/common.c
arch/x86/kvm/x86.c
include/linux/cpu.h

index 77c3d1a7f116f36284c4d27c5462f3c13abf85d2,73062d47a462ec1b2de45f0b69febfe2848309a5..825398d66c6963664cf34f3e4e64853e47d79211
                                               nospectre_bhb [ARM64]
                                               nospectre_v1 [X86,PPC]
                                               nospectre_v2 [X86,PPC,S390,ARM64]
+                                              reg_file_data_sampling=off [X86]
                                               retbleed=off [X86]
 +                                             spec_rstack_overflow=off [X86]
                                               spec_store_bypass_disable=off [X86,PPC]
                                               spectre_v2_user=off [X86]
                                               srbds=off [X86,INTEL]
Simple merge
Simple merge
Simple merge
index 4dd00066c12abf4b40ce3a5651619edc37fdd6a5,01ac18f56147f5e184e014e4661308a738c774ff..e7ba936d798b8198f5837118d5bb33d40389ccc7
@@@ -2846,9 -2922,9 +2923,14 @@@ ssize_t cpu_show_gds(struct device *dev
  {
        return cpu_show_common(dev, attr, buf, X86_BUG_GDS);
  }
+ ssize_t cpu_show_reg_file_data_sampling(struct device *dev, struct device_attribute *attr, char *buf)
+ {
+       return cpu_show_common(dev, attr, buf, X86_BUG_RFDS);
+ }
  #endif
 +
 +void __warn_thunk(void)
 +{
 +      WARN_ONCE(1, "Unpatched return thunk in use. This should not happen!\n");
 +}
Simple merge
Simple merge
Simple merge