diff options
author | Jens Axboe <axboe@kernel.dk> | 2025-08-12 08:30:11 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-08-12 13:41:26 -0600 |
commit | 41b70df5b38bc80967d2e0ed55cc3c3896bba781 (patch) | |
tree | ebe93432c3e63f9122cea4755e3cce49d39f3924 /scripts/gdb/linux/interrupts.py | |
parent | 8f5ae30d69d7543eee0d70083daf4de8fe15d585 (diff) |
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.
Cc: stable@vger.kernel.org
Reported-by: pt x <superman.xpt@gmail.com>
Fixes: c56e022c0a27 ("io_uring: add support for user mapped provided buffer ring")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'scripts/gdb/linux/interrupts.py')
0 files changed, 0 insertions, 0 deletions