powerpc/bpf: Fix detecting BPF atomic instructions
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
5.12.195.13.45.14In the Linux kernel, the following vulnerability has been resolved:
powerpc/bpf: Fix detecting BPF atomic instructions
Commit 91c960b0056672 ("bpf: Rename BPF_XADD and prepare to encode other atomics in .imm") converted BPF_XADD to BPF_ATOMIC and added a way to distinguish instructions based on the immediate field. Existing JIT implementations were updated to check for the immediate field and to reject programs utilizing anything more than BPF_ADD (such as BPF_FETCH) in the immediate field.
However, the check added to powerpc64 JIT did not look at the correct BPF instruction. Due to this, such programs would be accepted and incorrectly JIT'ed resulting in soft lockups, as seen with the atomic bounds test. Fix this by looking at the correct immediate value.
From the CVE record · Linux
The Linux kernel’s powerpc64 BPF JIT checks the wrong instruction when deciding whether to reject certain atomic operations. A BPF program using an unsupported atomic operation can therefore be accepted and incorrectly compiled, resulting in a soft lockup. The input does not specify access or authentication requirements.
Engineers running the Linux kernel on powerpc64 should check their BPF JIT exposure; affected versions are not specified.