net: skmsg: preserve sg.copy across SG transforms
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d3b18ad31f93d0b6bae105c679018a1ba7daa9ca · < 1acdd14c0990dd1cd4b6534f00366d2e6dfce05f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: skmsg: preserve sg.copy across SG transforms
The sk_msg sg.copy bitmap is part of the scatterlist entry ownership state. A set bit tells sk_msg_compute_data_pointers() not to expose the entry through writable BPF ctx->data. This protects entries backed by pages that are not private to the sk_msg, such as splice-backed file page-cache pages.
Several sk_msg transform paths move, copy, split, or compact msg->sg.data[] entries without moving the matching sg.copy bit. This can make an externally backed entry arrive at a new slot with a clear copy bit. A later SK_MSG verdict can then expose sg_virt(sge) as writable ctx->data and BPF stores can modify the original page cache.
Keep sg.copy synchronized with sg.data[] whenever entries are transferred, shifted, split, or copied into a new sk_msg. Clear the bit when an entry is replaced by a newly allocated private page or freed. This covers the BPF pull/push/pop helpers, sk_msg_shift_left/right(), sk_msg_xfer(), and tls_split_open_record(), including the partial tail entry created during TLS open-record splitting.
From the CVE record · Linux
In the Linux kernel, some skmsg transforms move scatterlist entries without preserving the bitmap that marks pages as not privately owned. If an externally backed entry is later exposed to a SK_MSG BPF verdict as writable data, BPF stores can modify the original page cache. The input does not specify attacker access requirements or whether user interaction is needed.
Engineers running the Linux kernel should check whether their kernels contain the affected skmsg code; affected versions are not specified.