bpf: sockmap: fix tail fragment offset in bpf_msg_push_data
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 6fff607e2f14bd7c63c06c464a6f93b8efbabe28 · < 5e19028667963fb371ebb00cecc2a473ef92056b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: sockmap: fix tail fragment offset in bpf_msg_push_data
When bpf_msg_push_data() inserts data in the middle of a scatterlist entry, it splits the original entry into a left fragment and a right fragment.
The right fragment offset is page-local, but the code advances it with `start`, which is the message-global insertion point. For inserts into a non-first SG entry, this over-advances the offset and leaves the split layout inconsistent.
Advance the right fragment offset by the fragment-local delta, `start - offset`, which matches the length removed from the front of the original entry.
From the CVE record · Linux
In the Linux kernel’s BPF sockmap, bpf_msg_push_data() calculates the right-fragment offset incorrectly when inserting data into a non-first scatterlist entry. This can leave the split layout inconsistent. The input does not specify an attacker path, authentication requirements, or user-interaction requirements.
Engineers running Linux kernels with BPF sockmap should check whether their kernel is affected; affected versions are not specified.