io_uring/net: initialize mshot_len for send
Jens Axboe
maintainerPATCH 1/1 io_uring/net: initialize mshot_len for send
Commit:
6a8afb9fff64 ("io_uring/net: allow multishot receive per-invocation cap")
changed how io_mshot_prep_retry() set sr->len, and added the same initialization in io_mshot_prep_retry(). But it neglected to touch the send path, which may also uses the mshot retry path. Ensure that sr->mshot_len always gets initialized correctly.
Fixes 6a8afb9fff64 ("io_uring/net: allow multishot receive per-invocation cap")
Reported-by Sung Keum <[email protected]>
Signed-off-by Jens Axboe <[email protected]>
---
io_uring/net.c +1 -0
@@ -445,6 +445,7 @@ int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) req->flags |=REQ_F_NOWAIT ;if (req->flags &REQ_F_BUFFER_SELECT ) sr->buf_group = req->buf_index; + sr->mshot_total_len = sr->mshot_len =0 ;if (sr->flags &IORING_RECVSEND_BUNDLE ) {if (req->opcode ==IORING_OP_SENDMSG )return -EINVAL ;
Signature · 1 line
Jens Axboe
Quoted 9 lines · Jens Axboe
Commit:
6a8afb9fff64("io_uring/net: allow multishot receive per-invocation cap")changed how
io_mshot_prep_retry()setsr->len, and added the same initialization inio_mshot_prep_retry(). But it neglected to touch the send path, which may also uses the mshot retry path. Ensure thatsr->mshot_lenalways gets initialized correctly.
Quoted 5 lines
Fixes 6a8afb9fff64 ("io_uring/net: allow multishot receive per-invocation cap")Reported-by Sung Keum <[email protected]>Signed-off-by Jens Axboe <[email protected]>
Reviewed-by Gabriel Krisman Bertazi <[email protected]>
Signature · 1 line
Gabriel Krisman Bertazi