xsk: Use a 32-bit compare in xsk_map_gen_lookup
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e65650f291ee72fc578d6346080fc4699204ef2c · < b5c0cff0c5331582ab01c4c423731453a8381acc| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
xsk: Use a 32-bit compare in xsk_map_gen_lookup
xsk_map_gen_lookup() loads a u32 key and compares it with max_entries using BPF_JMP_IMM. BPF immediates are sign-extended to 64 bits, so a max_entries value of 0x80000000 or higher becomes a threshold larger than every zero-extended 32-bit key. An out-of-range index then skips the bounds check and the generated lookup reads past xsk_map[].
Compare with BPF_JMP32_IMM so the check stays in 32-bit unsigned range.
From the CVE record · Linux
The Linux kernel’s xsk_map_gen_lookup can read past xsk_map[] when max_entries is 0x80000000 or higher and an out-of-range key bypasses the bounds check. The input does not specify whether exploitation requires network or local access, authentication, or user interaction.
Engineers running Linux kernels with the affected xsk_map_gen_lookup implementation should check their systems; affected versions are not specified.