CVE-2023-53024
EUVD-2023-5969627.03.2025, 17:15
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix pointer-leak due to insufficient speculative store bypass mitigation
To mitigate Spectre v4, 2039f26f3aca ("bpf: Fix leakage due to
insufficient speculative store bypass mitigation") inserts lfence
instructions after 1) initializing a stack slot and 2) spilling a
pointer to the stack.
However, this does not cover cases where a stack slot is first
initialized with a pointer (subject to sanitization) but then
overwritten with a scalar (not subject to sanitization because
the slot was already initialized). In this case, the second write
may be subject to speculative store bypass (SSB) creating a
speculative pointer-as-scalar type confusion. This allows the
program to subsequently leak the numerical pointer value using,
for example, a branch-based cache side channel.
To fix this, also sanitize scalars if they write a stack slot
that previously contained a pointer. Assuming that pointer-spills
are only generated by LLVM on register-pressure, the performance
impact on most real-world BPF programs should be small.
The following unprivileged BPF bytecode drafts a minimal exploit
and the mitigation:
[...]
// r6 = 0 or 1 (skalar, unknown user input)
// r7 = accessible ptr for side channel
// r10 = frame pointer (fp), to be leaked
//
r9 = r10 # fp alias to encourage ssb
*(u64 *)(r9 - 8) = r10 // fp[-8] = ptr, to be leaked
// lfence added here because of pointer spill to stack.
//
// Ommitted: Dummy bpf_ringbuf_output() here to train alias predictor
// for no r9-r10 dependency.
//
*(u64 *)(r10 - 8) = r6 // fp[-8] = scalar, overwrites ptr
// 2039f26f3aca: no lfence added because stack slot was not STACK_INVALID,
// store may be subject to SSB
//
// fix: also add an lfence when the slot contained a ptr
//
r8 = *(u64 *)(r9 - 8)
// r8 = architecturally a scalar, speculatively a ptr
//
// leak ptr using branch-based cache side channel:
r8 &= 1 // choose bit to leak
if r8 == 0 goto SLOW // no mispredict
// architecturally dead code if input r6 is 0,
// only executes speculatively iff ptr bit is 1
r8 = *(u64 *)(r7 + 0) # encode bit in cache (0: slow, 1: fast)
SLOW:
[...]
After running this, the program can time the access to *(r7 + 0) to
determine whether the chosen pointer bit was 0 or 1. Repeat this 64
times to recover the whole address on amd64.
In summary, sanitization can only be skipped if one scalar is
overwritten with another scalar. Scalar-confusion due to speculative
store bypass can not lead to invalid accesses because the pointer
bounds deducted during verification are enforced using branchless
logic. See 979d63d50c0c ("bpf: prevent out of bounds speculation on
pointer arithmetic") for details.
Do not make the mitigation depend on !env->allow_{uninit_stack,ptr_leaks}
because speculative leaks are likely unexpected if these were enabled.
For example, leaking the address to a protected log file may be acceptable
while disabling the mitigation might unintentionally leak the address
into the cached-state of a map that is accessible to unprivileged
processes.EnginsightAffected Products (NVD)
| Vendor | Product | Version |
|---|---|---|
| linux | linux_kernel | 4.19.207 ≤ 𝑥 < 4.19.272 |
| linux | linux_kernel | 5.4.146 ≤ 𝑥 < 5.4.231 |
| linux | linux_kernel | 5.10.56 ≤ 𝑥 < 5.10.166 |
| linux | linux_kernel | 5.13.8 ≤ 𝑥 < 5.14 |
| linux | linux_kernel | 5.14.1 ≤ 𝑥 < 5.15.91 |
| linux | linux_kernel | 5.16 ≤ 𝑥 < 6.1.9 |
| linux | linux_kernel | 5.14 |
| linux | linux_kernel | 5.14:rc4 |
| linux | linux_kernel | 5.14:rc5 |
| linux | linux_kernel | 5.14:rc6 |
| linux | linux_kernel | 5.14:rc7 |
| linux | linux_kernel | 6.2:rc1 |
| linux | linux_kernel | 6.2:rc2 |
| linux | linux_kernel | 6.2:rc3 |
| linux | linux_kernel | 6.2:rc4 |
𝑥
= Vulnerable software versions
Debian Releases
Ubuntu Releases
Ubuntu Product | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| linux |
| ||||||||||||||
| linux-allwinner-5.19 |
| ||||||||||||||
| linux-aws |
| ||||||||||||||
| linux-aws-5.0 |
| ||||||||||||||
| linux-aws-5.11 |
| ||||||||||||||
| linux-aws-5.13 |
| ||||||||||||||
| linux-aws-5.15 |
| ||||||||||||||
| linux-aws-5.19 |
| ||||||||||||||
| linux-aws-5.3 |
| ||||||||||||||
| linux-aws-5.4 |
| ||||||||||||||
| linux-aws-5.8 |
| ||||||||||||||
| linux-aws-6.2 |
| ||||||||||||||
| linux-aws-6.5 |
| ||||||||||||||
| linux-aws-6.8 |
| ||||||||||||||
| linux-aws-fips |
| ||||||||||||||
| linux-aws-hwe |
| ||||||||||||||
| linux-azure |
| ||||||||||||||
| linux-azure-4.15 |
| ||||||||||||||
| linux-azure-5.11 |
| ||||||||||||||
| linux-azure-5.13 |
| ||||||||||||||
| linux-azure-5.15 |
| ||||||||||||||
| linux-azure-5.19 |
| ||||||||||||||
| linux-azure-5.3 |
| ||||||||||||||
| linux-azure-5.4 |
| ||||||||||||||
| linux-azure-5.8 |
| ||||||||||||||
| linux-azure-6.2 |
| ||||||||||||||
| linux-azure-6.5 |
| ||||||||||||||
| linux-azure-6.8 |
| ||||||||||||||
| linux-azure-edge |
| ||||||||||||||
| linux-azure-fde |
| ||||||||||||||
| linux-azure-fde-5.15 |
| ||||||||||||||
| linux-azure-fde-5.19 |
| ||||||||||||||
| linux-azure-fde-6.2 |
| ||||||||||||||
| linux-azure-fips |
| ||||||||||||||
| linux-bluefield |
| ||||||||||||||
| linux-fips |
| ||||||||||||||
| linux-gcp |
| ||||||||||||||
| linux-gcp-4.15 |
| ||||||||||||||
| linux-gcp-5.11 |
| ||||||||||||||
| linux-gcp-5.13 |
| ||||||||||||||
| linux-gcp-5.15 |
| ||||||||||||||
| linux-gcp-5.19 |
| ||||||||||||||
| linux-gcp-5.3 |
| ||||||||||||||
| linux-gcp-5.4 |
| ||||||||||||||
| linux-gcp-5.8 |
| ||||||||||||||
| linux-gcp-6.2 |
| ||||||||||||||
| linux-gcp-6.5 |
| ||||||||||||||
| linux-gcp-6.8 |
| ||||||||||||||
| linux-gcp-fips |
| ||||||||||||||
| linux-gke |
| ||||||||||||||
| linux-gke-4.15 |
| ||||||||||||||
| linux-gke-5.15 |
| ||||||||||||||
| linux-gke-5.4 |
| ||||||||||||||
| linux-gkeop |
| ||||||||||||||
| linux-gkeop-5.15 |
| ||||||||||||||
| linux-gkeop-5.4 |
| ||||||||||||||
| linux-hwe |
| ||||||||||||||
| linux-hwe-5.11 |
| ||||||||||||||
| linux-hwe-5.13 |
| ||||||||||||||
| linux-hwe-5.15 |
| ||||||||||||||
| linux-hwe-5.19 |
| ||||||||||||||
| linux-hwe-5.4 |
| ||||||||||||||
| linux-hwe-5.8 |
| ||||||||||||||
| linux-hwe-6.11 |
| ||||||||||||||
| linux-hwe-6.2 |
| ||||||||||||||
| linux-hwe-6.5 |
| ||||||||||||||
| linux-hwe-6.8 |
| ||||||||||||||
| linux-hwe-edge |
| ||||||||||||||
| linux-ibm |
| ||||||||||||||
| linux-ibm-5.15 |
| ||||||||||||||
| linux-ibm-5.4 |
| ||||||||||||||
| linux-intel-5.13 |
| ||||||||||||||
| linux-intel-iot-realtime |
| ||||||||||||||
| linux-intel-iotg |
| ||||||||||||||
| linux-intel-iotg-5.15 |
| ||||||||||||||
| linux-iot |
| ||||||||||||||
| linux-kvm |
| ||||||||||||||
| linux-lowlatency |
| ||||||||||||||
| linux-lowlatency-hwe-5.15 |
| ||||||||||||||
| linux-lowlatency-hwe-5.19 |
| ||||||||||||||
| linux-lowlatency-hwe-6.11 |
| ||||||||||||||
| linux-lowlatency-hwe-6.2 |
| ||||||||||||||
| linux-lowlatency-hwe-6.5 |
| ||||||||||||||
| linux-lowlatency-hwe-6.8 |
| ||||||||||||||
| linux-lts-xenial |
| ||||||||||||||
| linux-nvidia |
| ||||||||||||||
| linux-nvidia-6.2 |
| ||||||||||||||
| linux-nvidia-6.5 |
| ||||||||||||||
| linux-nvidia-6.8 |
| ||||||||||||||
| linux-nvidia-lowlatency |
| ||||||||||||||
| linux-nvidia-tegra |
| ||||||||||||||
| linux-nvidia-tegra-igx |
| ||||||||||||||
| linux-oem |
| ||||||||||||||
| linux-oem-5.10 |
| ||||||||||||||
| linux-oem-5.13 |
| ||||||||||||||
| linux-oem-5.14 |
| ||||||||||||||
| linux-oem-5.17 |
| ||||||||||||||
| linux-oem-5.6 |
| ||||||||||||||
| linux-oem-6.0 |
| ||||||||||||||
| linux-oem-6.1 |
| ||||||||||||||
| linux-oem-6.11 |
| ||||||||||||||
| linux-oem-6.5 |
| ||||||||||||||
| linux-oem-6.8 |
| ||||||||||||||
| linux-oracle |
| ||||||||||||||
| linux-oracle-5.0 |
| ||||||||||||||
| linux-oracle-5.11 |
| ||||||||||||||
| linux-oracle-5.13 |
| ||||||||||||||
| linux-oracle-5.15 |
| ||||||||||||||
| linux-oracle-5.3 |
| ||||||||||||||
| linux-oracle-5.4 |
| ||||||||||||||
| linux-oracle-5.8 |
| ||||||||||||||
| linux-oracle-6.5 |
| ||||||||||||||
| linux-oracle-6.8 |
| ||||||||||||||
| linux-raspi |
| ||||||||||||||
| linux-raspi-5.4 |
| ||||||||||||||
| linux-raspi-realtime |
| ||||||||||||||
| linux-raspi2 |
| ||||||||||||||
| linux-realtime |
| ||||||||||||||
| linux-riscv |
| ||||||||||||||
| linux-riscv-5.11 |
| ||||||||||||||
| linux-riscv-5.15 |
| ||||||||||||||
| linux-riscv-5.19 |
| ||||||||||||||
| linux-riscv-5.8 |
| ||||||||||||||
| linux-riscv-6.5 |
| ||||||||||||||
| linux-riscv-6.8 |
| ||||||||||||||
| linux-starfive-5.19 |
| ||||||||||||||
| linux-starfive-6.2 |
| ||||||||||||||
| linux-starfive-6.5 |
| ||||||||||||||
| linux-xilinx-zynqmp |
|
openSUSE / SLES Releases
openSUSE Product | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| cluster-md-kmp-default |
| ||||||||||
| dlm-kmp-default |
| ||||||||||
| gfs2-kmp-default |
| ||||||||||
| kernel-64kb |
| ||||||||||
| kernel-default |
| ||||||||||
| kernel-default-base |
| ||||||||||
| kernel-default-man |
| ||||||||||
| kernel-docs |
| ||||||||||
| kernel-macros |
| ||||||||||
| kernel-obs-build |
| ||||||||||
| kernel-preempt |
| ||||||||||
| kernel-source |
| ||||||||||
| kernel-syms |
| ||||||||||
| kernel-zfcpdump |
| ||||||||||
| ocfs2-kmp-default |
| ||||||||||
| reiserfs-kmp-default |
|
Red Hat Enterprise Linux Releases
Red Hat Product | |||
|---|---|---|---|
| bpftool |
| ||
| kernel |
| ||
| kernel-64k |
| ||
| kernel-64k-core |
| ||
| kernel-64k-debug |
| ||
| kernel-64k-debug-core |
| ||
| kernel-64k-debug-devel |
| ||
| kernel-64k-debug-devel-matched |
| ||
| kernel-64k-debug-modules |
| ||
| kernel-64k-debug-modules-core |
| ||
| kernel-64k-debug-modules-extra |
| ||
| kernel-64k-devel |
| ||
| kernel-64k-devel-matched |
| ||
| kernel-64k-modules |
| ||
| kernel-64k-modules-core |
| ||
| kernel-64k-modules-extra |
| ||
| kernel-abi-stablelists |
| ||
| kernel-core |
| ||
| kernel-debug |
| ||
| kernel-debug-core |
| ||
| kernel-debug-devel |
| ||
| kernel-debug-devel-matched |
| ||
| kernel-debug-modules |
| ||
| kernel-debug-modules-core |
| ||
| kernel-debug-modules-extra |
| ||
| kernel-debug-uki-virt |
| ||
| kernel-devel |
| ||
| kernel-devel-matched |
| ||
| kernel-doc |
| ||
| kernel-modules |
| ||
| kernel-modules-core |
| ||
| kernel-modules-extra |
| ||
| kernel-rt |
| ||
| kernel-rt-core |
| ||
| kernel-rt-debug |
| ||
| kernel-rt-debug-core |
| ||
| kernel-rt-debug-devel |
| ||
| kernel-rt-debug-kvm |
| ||
| kernel-rt-debug-modules |
| ||
| kernel-rt-debug-modules-core |
| ||
| kernel-rt-debug-modules-extra |
| ||
| kernel-rt-devel |
| ||
| kernel-rt-kvm |
| ||
| kernel-rt-modules |
| ||
| kernel-rt-modules-core |
| ||
| kernel-rt-modules-extra |
| ||
| kernel-tools |
| ||
| kernel-tools-libs |
| ||
| kernel-tools-libs-devel |
| ||
| kernel-uki-virt |
| ||
| kernel-zfcpdump |
| ||
| kernel-zfcpdump-core |
| ||
| kernel-zfcpdump-devel |
| ||
| kernel-zfcpdump-devel-matched |
| ||
| kernel-zfcpdump-modules |
| ||
| kernel-zfcpdump-modules-core |
| ||
| kernel-zfcpdump-modules-extra |
| ||
| libperf |
| ||
| perf |
| ||
| python3-perf |
| ||
| rtla |
| ||
| rv |
|
References