From: David Wei <dw@davidwei.uk>
To: Jakub Kicinski <kuba@kernel.org>
Cc: io-uring@vger.kernel.org, netdev@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>,
Pavel Begunkov <asml.silence@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Subject: Re: [PATCH v2 2/2] net: io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock
Date: Wed, 29 Oct 2025 18:09:41 -0700 [thread overview]
Message-ID: <839bc664-0e4b-4e70-9a9e-6f0c4c896d9e@davidwei.uk> (raw)
In-Reply-To: <20251029165457.557f8f7d@kernel.org>
On 2025-10-29 16:54, Jakub Kicinski wrote:
> On Wed, 29 Oct 2025 16:16:54 -0700 David Wei wrote:
>> + ifq->netdev = netdev_get_by_index_lock(current->nsproxy->net_ns, reg.if_idx);
>> if (!ifq->netdev) {
>> ret = -ENODEV;
>> - goto err;
>> + goto netdev_unlock;
>> }
>>
>> ifq->dev = netdev_queue_get_dma_dev(ifq->netdev, reg.if_rxq);
>> if (!ifq->dev) {
>> ret = -EOPNOTSUPP;
>> - goto err;
>> + goto netdev_unlock;
>> }
>> + netdev_hold(ifq->netdev, &ifq->netdev_tracker, GFP_KERNEL);
>> get_device(ifq->dev);
>>
>> ret = io_zcrx_create_area(ifq, &area);
>> if (ret)
>> - goto err;
>> + goto netdev_unlock;
>
> Without looking at larger context this looks sus.
> You're jumping to the same label before and after you took the ref on
> the netdev..
Sorry you're right, and actually io_zcrx_ifq_free() does netdev_put()
unconditionally. I'll correct this in v3.
prev parent reply other threads:[~2025-10-30 1:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 23:16 [PATCH v2 0/2] net: io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock David Wei
2025-10-29 23:16 ` [PATCH v2 1/2] net: export netdev_get_by_index_lock() David Wei
2025-10-29 23:51 ` Jakub Kicinski
2025-10-30 1:09 ` David Wei
2025-10-29 23:16 ` [PATCH v2 2/2] net: io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock David Wei
2025-10-29 23:54 ` Jakub Kicinski
2025-10-30 1:09 ` David Wei [this message]
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=839bc664-0e4b-4e70-9a9e-6f0c4c896d9e@davidwei.uk \
--to=dw@davidwei.uk \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=io-uring@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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