io_uring/net: commit partial buffers on retry
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:
io_uring/net: commit partial buffers on retry
Ring provided buffers are potentially only valid within the single execution context in which they were acquired. io_uring deals with this and invalidates them on retry. But on the networking side, if MSG_WAITALL is set, or if the socket is of the streaming type and too little was processed, then it will hang on to the buffer rather than recycle or commit it. This is problematic for two reasons:
1) If someone unregisters the provided buffer ring before a later retry, then the req->buf_list will no longer be valid.
2) If multiple sockers are using the same buffer group, then multiple receives can consume the same memory. This can cause data corruption in the application, as either receive could land in the same userspace buffer.
Fix this by disallowing partial retries from pinning a provided buffer across multiple executions, if ring provided buffers are used.
From the CVE record · Linux
Linux io_uring networking can retain a ring-provided buffer across receive retries when MSG_WAITALL is set or a streaming socket processes too little data. If the buffer ring is unregistered before a retry, the buffer reference can become invalid; receives sharing a buffer group can also write to the same userspace memory, causing application data corruption. The input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels that use io_uring ring-provided buffers for network receives should check their kernel; affected versions are not specified.