In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix kernel address leakage in atomic fetch
The change in commit 37086bfdc737 ("bpf: Propagate stack bounds to registers in atomics w/ BPF_FETCH") around check_mem_access() handling is buggy since this would allow for unprivileged users to leak kernel pointers. For example, an atomic fetch/and with -1 on a stack destination which holds a spilled pointer will migrate the spilled register type into a scalar, which can then be exported out of the program (since scalar != pointer) by dumping it into a map value.
The original implementation of XADD was preventing this situation by using a double call to check_mem_access() one with BPF_READ and a subsequent one with BPF_WRITE, in both cases passing -1 as a placeholder value instead of register as per XADD semantics since it didn't contain a value fetch. The BPF_READ also included a check in check_stack_read_fixed_off() which rejects the program if the stack slot is of __is_pointer_value() if dst_regno < 0. The latter is to distinguish whether we're dealing with a regular stack spill/ fill or some arithmetical operation which is disallowed on non-scalars, see also 6e7e63cbb023 ("bpf: Forbid XADD on spilled pointers for unprivileged users") for more context on check_mem_access() and its handling of placeholder value -1.
One minimally intrusive option to fix the leak is for the BPF_FETCH case to initially check the BPF_READ case via check_mem_access() with -1 as register, followed by the actual load case with non-negative load_reg to propagate stack bounds to registers.
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Debian | — | Upgrade linux | Jul 30, 2024 | Jun 19, 2024 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | Jun 19, 2024 |
| Suse | — | Upgrade kselftests-kmp-azureUpgrade kernel-source-azureUpgrade kernel-rt_debug-develUpgrade kernel-rt-optionalUpgrade gfs2-kmp-azureUpgrade kernel-azure-optionalUpgrade kernel-azure-livepatch-develUpgrade kernel-rt_debugUpgrade kernel-source-rtUpgrade kernel-azure-extraUpgrade kernel-devel-azureUpgrade gfs2-kmp-rtUpgrade cluster-md-kmp-azureUpgrade ocfs2-kmp-rtUpgrade kernel-syms-azureUpgrade reiserfs-kmp-rtUpgrade kernel-rt-livepatch-develUpgrade reiserfs-kmp-azureUpgrade kernel-rt_debug-livepatch-develUpgrade kernel-rt-vdsoUpgrade dlm-kmp-rtUpgrade ocfs2-kmp-azureUpgrade kernel-azureUpgrade kernel-syms-rtUpgrade kernel-rtUpgrade kernel-rt_debug-vdsoUpgrade cluster-md-kmp-rtUpgrade kernel-azure-vdsoUpgrade dlm-kmp-azureUpgrade kernel-devel-rtUpgrade kernel-azure-develUpgrade kselftests-kmp-rtUpgrade kernel-rt-extraUpgrade kernel-rt-livepatchUpgrade kernel-rt-devel | Aug 9, 2024 | Jun 19, 2024 |
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub