From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, Sasha Levin <sashal@kernel.org>,
stable@vger.kernel.org
Cc: io-uring@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: FAILED: Patch "io_uring/zcrx: fix post open error handling" failed to apply to 6.18-stable tree
Date: Mon, 2 Mar 2026 10:02:59 +0000 [thread overview]
Message-ID: <53896290-9a0a-4822-854f-945595a19fe0@gmail.com> (raw)
In-Reply-To: <002c2bb8-3304-40e0-b8c6-8eee7dcb7710@kernel.dk>
On 3/1/26 13:22, Jens Axboe wrote:
> On 2/28/26 6:17 PM, Sasha Levin wrote:
>> The patch below does not apply to the 6.18-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>.
>
> Looks like this has dependencies on parts of this:
>
> https://lore.kernel.org/io-uring/cover.1763029704.git.asml.silence@gmail.com/
>
> series. But seems easier to just do a variant for the 6.18 base,
> I'll leave that to Pavel.
I was thinking to remove post open error handling. xarray is preallocated
and shouldn't fail. And copy_to_user can be moved earlier. Should be safer
than taking all deps.
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index c524be7109c2..c6ac7365acae 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -625,6 +625,14 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
if (ret)
goto netdev_put_unlock;
+ reg.zcrx_id = id;
+ if (copy_to_user(arg, ®, sizeof(reg)) ||
+ copy_to_user(u64_to_user_ptr(reg.region_ptr), &rd, sizeof(rd)) ||
+ copy_to_user(u64_to_user_ptr(reg.area_ptr), &area, sizeof(area))) {
+ ret = -EFAULT;
+ goto err;
+ }
+
mp_param.mp_ops = &io_uring_pp_zc_ops;
mp_param.mp_priv = ifq;
ret = __net_mp_open_rxq(ifq->netdev, reg.if_rxq, &mp_param, NULL);
@@ -633,21 +641,11 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
netdev_unlock(ifq->netdev);
ifq->if_rxq = reg.if_rxq;
- reg.zcrx_id = id;
-
scoped_guard(mutex, &ctx->mmap_lock) {
/* publish ifq */
- ret = -ENOMEM;
- if (xa_store(&ctx->zcrx_ctxs, id, ifq, GFP_KERNEL))
- goto err;
+ xa_store(&ctx->zcrx_ctxs, id, ifq, GFP_KERNEL);
}
- if (copy_to_user(arg, ®, sizeof(reg)) ||
- copy_to_user(u64_to_user_ptr(reg.region_ptr), &rd, sizeof(rd)) ||
- copy_to_user(u64_to_user_ptr(reg.area_ptr), &area, sizeof(area))) {
- ret = -EFAULT;
- goto err;
- }
return 0;
netdev_put_unlock:
netdev_put(ifq->netdev, &ifq->netdev_tracker);
--
Pavel Begunkov
next prev parent reply other threads:[~2026-03-02 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 1:17 FAILED: Patch "io_uring/zcrx: fix post open error handling" failed to apply to 6.18-stable tree Sasha Levin
2026-03-01 13:22 ` Jens Axboe
2026-03-02 10:02 ` Pavel Begunkov [this message]
2026-03-02 17:27 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53896290-9a0a-4822-854f-945595a19fe0@gmail.com \
--to=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox