bpf: Fix stack slot index in nospec checks
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2039f26f3aca5b0e419b98f65dd36481337b86ee · < 68b41e68a62299f26cb16af422b5c7d1c69dafd9| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix stack slot index in nospec checks
check_stack_write_fixed_off() computes the byte slot for a fixed-offset stack write as -off - 1, and records each written byte in slot_type[] with (slot - i) % BPF_REG_SIZE.
The Spectre v4 sanitization pre-check uses slot_type[i] instead. For a 4-byte write at fp-8 after the lower half of fp-8 has been zeroed, the pre-check scans bytes 0..3 and sees STACK_ZERO while the actual write updates bytes 7..4. That can leave the second half-slot write without nospec_result even though the bytes being overwritten still require sanitization.
Use the same slot index in the sanitization pre-check that the write path uses when updating slot_type[].
From the CVE record · Linux
The Linux kernel’s BPF stack write check uses the wrong byte index during its Spectre v4 sanitization pre-check. Under the described fixed-offset stack-write conditions, a write can proceed without a needed sanitization result. The input does not establish an attacker path, authentication requirements, or user-interaction requirements.
Engineers running Linux kernels with BPF support should check their vendor’s affected-version guidance; no versions are listed in the input.