mirror-linux/tools/testing/selftests
Linus Torvalds 6f5bf947ba * Mitigate Indirect Target Selection (ITS) issue
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEV76QKkVc4xCGURexaDWVMHDJkrAFAmgebIwACgkQaDWVMHDJ
 krCGSA/+I+W/uqiz58Z2Zu4RrXMYFfKJxacF7My9wnOyRxaJduS3qrz1E5wHqBId
 f6M8wDx9nS24UxDkBbi84NdtlG1zj8nV8djtszGKVeqHG2DcQMMOXBKZSjOmTo2b
 GIZ3a3xEqXaFfnGQxXSZrvtHIwCmv10H2oyGHu0vBp/SJuWXNg72oivOGhbm0uWs
 0/bdIK8+1sW7OAmhhKdvMVpmzL8TQJnkUHSkQilPB2Tsf9wWDfeY7kDkK5YwQpk2
 ZK+hrmwCFXQZELY65F2+y/cFim/F38HiqVdvIkV1wFSVqVVE9hEKJ4BDZl1fXZKB
 p4qpDFgxO27E/eMo9IZfxRH4TdSoK6YLWo9FGWHKBPnciJfAeO9EP/AwAIhEQRdx
 YZlN9sGS6ja7O1Eh423BBw6cFj6ta0ck2T1PoYk32FXc6sgqCphsfvBD3+tJxz8/
 xoZ3BzoErdPqSXbH5cSI972kQW0JLESiMTZa827qnJtT672t6uBcsnnmR0ZbJH1f
 TJCC9qgwpBiEkiGW3gwv00SC7CkXo3o0FJw0pa3MkKHGd7csxBtGBHI1b6Jj+oB0
 yWf1HxSqwrq2Yek8R7lWd4jIxyWfKriEMTu7xCMUUFlprKmR2RufsADvqclNyedQ
 sGBCc4eu1cpZp2no/IFm+IvkuzUHnkS/WNL1LbZ9YI8h8unjZHE=
 =UVgZ
 -----END PGP SIGNATURE-----

Merge tag 'its-for-linus-20250509' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 ITS mitigation from Dave Hansen:
 "Mitigate Indirect Target Selection (ITS) issue.

  I'd describe this one as a good old CPU bug where the behavior is
  _obviously_ wrong, but since it just results in bad predictions it
  wasn't wrong enough to notice. Well, the researchers noticed and also
  realized that thus bug undermined a bunch of existing indirect branch
  mitigations.

  Thus the unusually wide impact on this one. Details:

  ITS is a bug in some Intel CPUs that affects indirect branches
  including RETs in the first half of a cacheline. Due to ITS such
  branches may get wrongly predicted to a target of (direct or indirect)
  branch that is located in the second half of a cacheline. Researchers
  at VUSec found this behavior and reported to Intel.

  Affected processors:

   - Cascade Lake, Cooper Lake, Whiskey Lake V, Coffee Lake R, Comet
     Lake, Ice Lake, Tiger Lake and Rocket Lake.

  Scope of impact:

   - Guest/host isolation:

     When eIBRS is used for guest/host isolation, the indirect branches
     in the VMM may still be predicted with targets corresponding to
     direct branches in the guest.

   - Intra-mode using cBPF:

     cBPF can be used to poison the branch history to exploit ITS.
     Realigning the indirect branches and RETs mitigates this attack
     vector.

   - User/kernel:

     With eIBRS enabled user/kernel isolation is *not* impacted by ITS.

   - Indirect Branch Prediction Barrier (IBPB):

     Due to this bug indirect branches may be predicted with targets
     corresponding to direct branches which were executed prior to IBPB.
     This will be fixed in the microcode.

  Mitigation:

  As indirect branches in the first half of cacheline are affected, the
  mitigation is to replace those indirect branches with a call to thunk that
  is aligned to the second half of the cacheline.

  RETs that take prediction from RSB are not affected, but they may be
  affected by RSB-underflow condition. So, RETs in the first half of
  cacheline are also patched to a return thunk that executes the RET aligned
  to second half of cacheline"

* tag 'its-for-linus-20250509' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  selftest/x86/bugs: Add selftests for ITS
  x86/its: FineIBT-paranoid vs ITS
  x86/its: Use dynamic thunks for indirect branches
  x86/ibt: Keep IBT disabled during alternative patching
  mm/execmem: Unify early execmem_cache behaviour
  x86/its: Align RETs in BHB clear sequence to avoid thunking
  x86/its: Add support for RSB stuffing mitigation
  x86/its: Add "vmexit" option to skip mitigation on some CPUs
  x86/its: Enable Indirect Target Selection mitigation
  x86/its: Add support for ITS-safe return thunk
  x86/its: Add support for ITS-safe indirect thunk
  x86/its: Enumerate Indirect Target Selection (ITS) bug
  Documentation: x86/bugs/its: Add ITS documentation
2025-05-11 17:23:03 -07:00
..
acct selftests: acct: Add ksft_exit_skip if not running as root 2025-01-14 17:06:31 -07:00
alsa selftests/alsa: Fix circular dependency involving global-timer 2024-12-20 10:00:41 +01:00
amd-pstate
arm64 CRC updates for 6.15 2025-03-25 18:33:04 -07:00
bpf selftests/bpf: Correct typo in __clang_major__ macro 2025-04-25 16:56:10 -07:00
breakpoints selftests: breakpoints: use remaining time to check if suspend succeed 2024-10-02 14:37:30 -06:00
cachestat selftests: cachestat: Fix build warnings on ppc64 2024-05-29 12:24:44 -06:00
capabilities
cgroup selftest/cgroup: Add a remote partition transition test to test_cpuset_prs.sh 2025-03-31 13:28:19 -10:00
clone3 selftests/pidfd: fixes syscall number defines 2025-03-25 14:59:05 +01:00
connector
core selftests: core: add unshare_test to gitignore 2024-09-30 11:42:11 -06:00
coredump selftests: coredump: Add stackdump test 2025-01-04 10:12:18 +01:00
cpu-hotplug
cpufreq selftests/cpufreq: gitignore output files and clean them in make clean 2024-12-09 17:51:41 -07:00
damon selftests/damon/damon_nr_regions: sort collected regiosn before checking with min/max boundaries 2025-03-05 21:36:16 -08:00
devices kselftest/devices/probe: Fix SyntaxWarning in regex strings for Python3 2024-10-02 14:30:58 -06:00
dma selftests/dma:remove unused variable 2024-07-11 11:23:55 -06:00
dmabuf-heaps kselftests: dmabuf-heaps: Ensure the driver name is null-terminated 2024-07-29 09:02:54 +02:00
drivers selftests: drv: net: add version indicator 2025-05-05 18:17:16 -07:00
dt kselftest: dt: Ignore nodes that have ancestors disabled 2024-09-05 07:54:16 -05:00
efivarfs selftests/efivarfs: add concurrent update tests 2025-01-21 16:34:41 +01:00
exec AT_EXECVE_CHECK update for v6.14-rc1 (fix1) 2025-01-31 17:12:31 -08:00
fchmodat2 selftests/fchmodat2: fix clang build failure due to -static-libasan 2024-06-11 15:05:05 -06:00
filelock
filesystems selftests/fs/mount-notify: test also remove/flush of mntns marks 2025-04-24 11:00:28 +02:00
firmware
fpu
ftrace tracing fixes for v6.15 2025-04-19 11:57:36 -07:00
futex selftests/futex: futex_waitv wouldblock test should fail 2025-04-08 16:50:19 -06:00
gpio selftests: gpio: gpio-sim: Fix missing chip disablements 2025-01-23 15:44:48 +01:00
hid lib/crc: remove unnecessary prompt for CONFIG_CRC_T10DIF 2025-04-04 11:31:42 -07:00
ia64
intel_pstate selftests/intel_pstate: check if cpupower is installed 2024-10-28 21:18:57 -06:00
iommu iommufd: Test attach before detaching pasid 2025-03-28 11:40:41 -03:00
ipc selftests/ipc: Remove unused variables 2025-01-14 17:06:31 -07:00
ir
kcmp
kexec
kmod
kselftest printf: convert self-test to KUnit 2025-03-13 10:26:33 -07:00
kvm KVM: arm64: selftest: Don't try to disable AArch64 support 2025-05-05 12:19:45 -07:00
landlock selftests/landlock: Add PID tests for audit records 2025-04-11 12:53:22 +02:00
lib lib/prime_numbers: KUnit test should not select PRIME_NUMBERS 2025-04-15 13:50:43 -07:00
livepatch Livepatching changes for 6.15 2025-03-27 19:26:10 -07:00
lkdtm lkdtm/bugs: add test for hung smp_call_function_single() 2024-06-17 11:17:31 -07:00
locking
lsm selftests: refactor the lsm `flags_overset_lsm_set_self_attr` test 2024-12-18 18:14:29 -05:00
media_tests selftest: media_tests: fix trivial UAF typo 2025-01-14 17:06:31 -07:00
membarrier
memfd selftests/memfd/memfd_test: fix possible NULL pointer dereference 2025-01-25 20:22:44 -08:00
memory-hotplug
mincore 31 hotfixes. 9 are cc:stable and the remainder address post-6.15 issues 2025-04-16 20:07:32 -07:00
mm selftests/mm: fix a build failure on powerpc 2025-05-07 23:39:41 -07:00
module selftests: find_symbol: Actually use load_mod() parameter 2024-11-28 11:17:38 -08:00
mount
mount_setattr selftests: test subdirectory mounting 2025-03-04 09:29:55 +01:00
move_mount_set_group
mqueue selftests/mqueue: fix 5 warnings about signed/unsigned mismatches 2024-06-24 22:25:03 -07:00
mseal_system_mappings selftest: test system mappings are sealed 2025-04-01 15:17:16 -07:00
nci
net selftests: Add IPv6 link-local address generation tests for GRE devices. 2025-05-05 18:08:15 -07:00
nolibc selftests/nolibc: stop testing constructor order 2025-03-07 07:34:12 +01:00
ntb
openat2 selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS 2024-06-11 15:00:11 -06:00
pci_endpoint misc: pci_endpoint_test: Add support for PCITEST_IRQ_TYPE_AUTO 2025-03-26 06:11:54 +00:00
pcie_bwctrl selftests/pcie_bwctrl: Fix test progs list 2025-04-18 08:23:22 -05:00
perf_events
pid_namespace tests/pid_namespace: add pid_max tests 2024-12-02 11:25:25 +01:00
pidfd selftests/pidfd: fixes syscall number defines 2025-03-25 14:59:05 +01:00
power_supply
powerpc powerpc updates for 6.15 2025-03-27 19:39:08 -07:00
prctl
proc - In the series "treewide: Refactor heap related implementation", 2024-07-21 17:56:22 -07:00
pstore
ptp testptp: Add option to open PHC in readonly mode 2025-03-05 12:43:54 +00:00
ptrace
rcutorture Merge branches 'docs.2025.02.04a', 'lazypreempt.2025.03.04a', 'misc.2025.03.04a', 'srcu.2025.02.05a' and 'torture.2025.02.05a' 2025-03-04 18:47:32 -08:00
resctrl selftests/resctrl: Discover SNC kernel support and adjust messages 2025-01-14 17:06:32 -07:00
ring-buffer selftests/ring-buffer: Add test for out-of-bound pgoff mapping 2025-01-14 17:06:32 -07:00
riscv selftests: riscv: fix v_exec_initval_nolibc.c 2025-04-01 07:03:04 +00:00
rlimits
rseq rseq/selftests: Fix namespace collision with rseq UAPI header 2025-03-19 21:26:24 +01:00
rtc rtc: remove 'setdate' test program 2025-04-01 15:25:15 +02:00
rust selftests: rust: config: disable GCC_PLUGINS 2024-08-11 17:32:55 -06:00
safesetid
sched sched/debug: Remove CONFIG_SCHED_DEBUG from self-test config files 2025-03-19 22:23:24 +01:00
sched_ext Scheduler updates for v6.15: 2025-03-24 21:28:12 -07:00
seccomp selftests/seccomp: Add hard-coded __NR_uretprobe for x86_64 2025-02-10 09:26:19 -08:00
sgx selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
signal selftests: Add a test mangling with uc_sigmask 2024-10-29 01:01:49 -06:00
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl selftests/sysctl: fix wording of help messages 2025-02-27 10:02:12 +01:00
tc-testing selftests/tc-testing: Add a test case to cover basic HTB+FQ_CODEL case 2025-05-05 13:51:33 -07:00
tdx
thermal/intel
timens selftest/timerns: fix clang build failures for abs() calls 2024-07-05 13:21:48 -06:00
timers selftests/timers: Improve skew_consistency by testing with other clockids 2025-03-21 19:16:18 +01:00
tmpfs selftests: tmpfs: Add kselftest support to tmpfs 2025-01-14 17:06:32 -07:00
tpm2 selftests: tpm2: test_smoke: use POSIX-conformant expression operator 2025-04-08 14:56:13 -06:00
tty
turbostat tools/power turbostat: Add selftests for added perf counters 2024-07-26 13:51:25 -04:00
ublk selftests: ublk: fix UBLK_F_NEED_GET_DATA 2025-04-29 06:01:36 -06:00
uevent
user_events selftests/user_events: Fix failures caused by test code 2025-02-24 16:37:17 -07:00
vDSO Updates for the VDSO infrastructure: 2025-03-25 11:30:42 -07:00
watchdog selftests/watchdog-test: Fix system accidentally reset after watchdog-test 2024-10-28 21:34:43 -06:00
wireguard sched/debug: Remove CONFIG_SCHED_DEBUG from self-test config files 2025-03-19 22:23:24 +01:00
x86 selftest/x86/bugs: Add selftests for ITS 2025-05-09 13:39:45 -07:00
zram selftests/zram: gitignore output file 2025-01-14 17:06:31 -07:00
.gitignore selftests: tpm2: create a dedicated .gitignore 2025-04-08 14:56:13 -06:00
Makefile selftest/x86/bugs: Add selftests for ITS 2025-05-09 13:39:45 -07:00
gen_kselftest_tar.sh
kselftest.h Revert "selftests: kselftest: Fix build failure with NOLIBC" 2025-02-26 22:13:48 +01:00
kselftest_deps.sh
kselftest_harness.h selftests: harness: fix printing of mismatch values in __EXPECT() 2025-01-14 17:06:32 -07:00
kselftest_install.sh
kselftest_module.h
lib.mk selftests: Add headers target 2025-03-03 20:00:12 +01:00
run_kselftest.sh selftests/run_kselftest.sh: Fix help string for --per-test-log 2025-01-14 17:06:32 -07:00