bpf: Preserve id of register in sync_linked_regs()
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: Preserve id of register in sync_linked_regs()
sync_linked_regs() copies the id of known_reg to reg when propagating bounds of known_reg to reg using the off of known_reg, but when known_reg was linked to reg like:
known_reg = reg ; both known_reg and reg get same id known_reg += 4 ; known_reg gets off = 4, and its id gets BPF_ADD_CONST
now when a call to sync_linked_regs() happens, let's say with the following:
if known_reg >= 10 goto pc+2
known_reg's new bounds are propagated to reg but now reg gets BPF_ADD_CONST from the copy.
This means if another link to reg is created like:
From the CVE record · Linux
The Linux kernel BPF verifier can incorrectly change a register ID while propagating bounds between linked registers. When verifying a BPF program with this register pattern, it can lose the link, miss a bounds update, and allow execution to reach division by zero. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with the affected BPF verifier should check their kernel versions against the vendor advisory; affected versions are not specified.