diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-09-15 13:55:29 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-09-15 13:55:29 -0700 |
commit | 31d8fddb588bc7e3ba40bffa7573b7f7c7c73aa3 (patch) | |
tree | 33d46e502c482f21f22b5e5db96f00d7da5fbbe2 | |
parent | 0e494be7c557829344fd5a89d038864efd888c43 (diff) | |
parent | c21a8027ad8a68c340d0d58bf1cc61dcb0bc4d2f (diff) | |
download | lwn-31d8fddb588bc7e3ba40bffa7573b7f7c7c73aa3.tar.gz lwn-31d8fddb588bc7e3ba40bffa7573b7f7c7c73aa3.zip |
Merge tag 'io_uring-6.6-2023-09-15' of git://git.kernel.dk/linux
Pull io_uring fix from Jens Axboe:
"Just a single fix, fixing a regression with poll first, recvmsg, and
using a provided buffer"
* tag 'io_uring-6.6-2023-09-15' of git://git.kernel.dk/linux:
io_uring/net: fix iter retargeting for selected buf
-rw-r--r-- | io_uring/net.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index 3d07bf79c1e0..7a8e298af81b 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -183,6 +183,10 @@ static int io_setup_async_msg(struct io_kiocb *req, memcpy(async_msg, kmsg, sizeof(*kmsg)); if (async_msg->msg.msg_name) async_msg->msg.msg_name = &async_msg->addr; + + if ((req->flags & REQ_F_BUFFER_SELECT) && !async_msg->msg.msg_iter.nr_segs) + return -EAGAIN; + /* if were using fast_iov, set it to the new one */ if (iter_is_iovec(&kmsg->msg.msg_iter) && !kmsg->free_iov) { size_t fast_idx = iter_iov(&kmsg->msg.msg_iter) - kmsg->fast_iov; @@ -542,6 +546,7 @@ static int io_recvmsg_copy_hdr(struct io_kiocb *req, struct io_async_msghdr *iomsg) { iomsg->msg.msg_name = &iomsg->addr; + iomsg->msg.msg_iter.nr_segs = 0; #ifdef CONFIG_COMPAT if (req->ctx->compat) |