* FAILED: patch "[PATCH] io_uring/net: fix accept multishot handling" failed to apply to 6.6-stable tree
@ 2025-04-17 10:46 gregkh
2025-04-17 18:40 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2025-04-17 10:46 UTC (permalink / raw)
To: asml.silence, axboe; +Cc: stable
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x f6a89bf5278d6e15016a736db67043560d1b50d5
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2025041711-juniper-slapstick-265c@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f6a89bf5278d6e15016a736db67043560d1b50d5 Mon Sep 17 00:00:00 2001
From: Pavel Begunkov <asml.silence@gmail.com>
Date: Sun, 23 Feb 2025 17:22:29 +0000
Subject: [PATCH] io_uring/net: fix accept multishot handling
REQ_F_APOLL_MULTISHOT doesn't guarantee it's executed from the multishot
context, so a multishot accept may get executed inline, fail
io_req_post_cqe(), and ask the core code to kill the request with
-ECANCELED by returning IOU_STOP_MULTISHOT even when a socket has been
accepted and installed.
Cc: stable@vger.kernel.org
Fixes: 390ed29b5e425 ("io_uring: add IORING_ACCEPT_MULTISHOT for accept")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/51c6deb01feaa78b08565ca8f24843c017f5bc80.1740331076.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/io_uring/net.c b/io_uring/net.c
index 1d1107fd5beb..926cdb8d3350 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -1641,6 +1641,8 @@ int io_accept(struct io_kiocb *req, unsigned int issue_flags)
}
io_req_set_res(req, ret, cflags);
+ if (!(issue_flags & IO_URING_F_MULTISHOT))
+ return IOU_OK;
return IOU_STOP_MULTISHOT;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: FAILED: patch "[PATCH] io_uring/net: fix accept multishot handling" failed to apply to 6.6-stable tree
2025-04-17 10:46 FAILED: patch "[PATCH] io_uring/net: fix accept multishot handling" failed to apply to 6.6-stable tree gregkh
@ 2025-04-17 18:40 ` Jens Axboe
2025-04-22 6:38 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2025-04-17 18:40 UTC (permalink / raw)
To: gregkh, asml.silence; +Cc: stable
[-- Attachment #1: Type: text/plain, Size: 401 bytes --]
On 4/17/25 4:46 AM, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 6.6-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
This one applies to both 6.1-stable and 6.6-stable, can you queue
it up for both? Thanks!
--
Jens Axboe
[-- Attachment #2: 0001-io_uring-net-fix-accept-multishot-handling.patch --]
[-- Type: text/x-patch, Size: 1312 bytes --]
From 6a69d144661781a1e60228e26bb26985ca66723a Mon Sep 17 00:00:00 2001
From: Pavel Begunkov <asml.silence@gmail.com>
Date: Sun, 23 Feb 2025 17:22:29 +0000
Subject: [PATCH] io_uring/net: fix accept multishot handling
Commit f6a89bf5278d6e15016a736db67043560d1b50d5 upstream.
REQ_F_APOLL_MULTISHOT doesn't guarantee it's executed from the multishot
context, so a multishot accept may get executed inline, fail
io_req_post_cqe(), and ask the core code to kill the request with
-ECANCELED by returning IOU_STOP_MULTISHOT even when a socket has been
accepted and installed.
Cc: stable@vger.kernel.org
Fixes: 390ed29b5e425 ("io_uring: add IORING_ACCEPT_MULTISHOT for accept")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/51c6deb01feaa78b08565ca8f24843c017f5bc80.1740331076.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
io_uring/net.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/io_uring/net.c b/io_uring/net.c
index d56e8a47e50f..898990e71367 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -1391,6 +1391,8 @@ int io_accept(struct io_kiocb *req, unsigned int issue_flags)
goto retry;
io_req_set_res(req, ret, 0);
+ if (!(issue_flags & IO_URING_F_MULTISHOT))
+ return IOU_OK;
return IOU_STOP_MULTISHOT;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: FAILED: patch "[PATCH] io_uring/net: fix accept multishot handling" failed to apply to 6.6-stable tree
2025-04-17 18:40 ` Jens Axboe
@ 2025-04-22 6:38 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2025-04-22 6:38 UTC (permalink / raw)
To: Jens Axboe; +Cc: asml.silence, stable
On Thu, Apr 17, 2025 at 12:40:15PM -0600, Jens Axboe wrote:
> On 4/17/25 4:46 AM, gregkh@linuxfoundation.org wrote:
> >
> > The patch below does not apply to the 6.6-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
>
> This one applies to both 6.1-stable and 6.6-stable, can you queue
> it up for both? Thanks!
Now applied, thanks.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-22 6:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 10:46 FAILED: patch "[PATCH] io_uring/net: fix accept multishot handling" failed to apply to 6.6-stable tree gregkh
2025-04-17 18:40 ` Jens Axboe
2025-04-22 6:38 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox