bpf: Don't predict JMP32 pointer vs zero comparisons
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: Don't predict JMP32 pointer vs zero comparisons
Consider the following program:
r1 = map_value; /* low 32 bits are zero at runtime */ r6 = 0xdead000000000000; if w1 != 0 goto l1; l0: r1 += r6; r2 = *(u64 *)(r1 + 0); exit; l1: r6 = 0; goto l0;
At the moment is_branch_taken() reports the jump as always taken, because it does not distinguish between BPF_JMP and BPF_JMP32 comparisons when processing 'if w1 != 0 ...'.
From the CVE record · Linux
The Linux kernel BPF verifier can incorrectly predict the outcome of a 32-bit pointer-versus-zero comparison because it does not distinguish BPF_JMP32 from BPF_JMP. This can cause the verifier to treat a jump as always taken when it is not. The input does not establish whether exploitation requires network or local access, authentication, or user interaction.
Engineers running Linux kernels with the affected BPF verifier behavior should check their kernel versions; the input does not identify affected versions.