diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-02-01 16:42:36 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-02-01 16:42:36 +0300 |
commit | 72bd80252feeb3bef8724230ee15d9f7ab541c6e (patch) | |
tree | dabc690cf67a86760697180a038ba4b9e4a4b82b /include/linux/fpga/fpga-mgr.h | |
parent | 76b367a2d83163cf19173d5cb0b562acbabc8eac (diff) | |
download | linux-72bd80252feeb3bef8724230ee15d9f7ab541c6e.tar.xz |
io_uring/net: fix sr->len for IORING_OP_RECV with MSG_WAITALL and buffers
If we use IORING_OP_RECV with provided buffers and pass in '0' as the
length of the request, the length is retrieved from the selected buffer.
If MSG_WAITALL is also set and we get a short receive, then we may hit
the retry path which decrements sr->len and increments the buffer for
a retry. However, the length is still zero at this point, which means
that sr->len now becomes huge and import_ubuf() will cap it to
MAX_RW_COUNT and subsequently return -EFAULT for the range as a whole.
Fix this by always assigning sr->len once the buffer has been selected.
Cc: stable@vger.kernel.org
Fixes: 7ba89d2af17a ("io_uring: ensure recv and recvmsg handle MSG_WAITALL correctly")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/fpga/fpga-mgr.h')
0 files changed, 0 insertions, 0 deletions