mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Umang Pokhriyal <umangpokhriyall@gmail.com>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Jason Wang <jasowangio@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] tun: delete the flow entries of the moved queue on detach
Date: Sat, 14 Nov 2026 18:51:50 +0530	[thread overview]
Message-ID: <20261114132237.70664-1-umangpokhriyall@gmail.com> (raw)
In-Reply-To: <179415734502.994134.10139593761656069984@kernel.org>

On Sun, 08 Nov 2026 17:02:25 +0000, netdev-bot+sashiko@kernel.org wrote:
> Can a concurrent write() still put back an entry that points at the old
> index after this delete has run?

Yes. On the write() path tun_flow_update() reads tfile->queue_index
outside any RCU section, and synchronize_net() does not wait for it.
The race predates this patch. Before the patch the entries survived
every detach. With it, only a write() that stalls across the
synchronize_net() can store the old index again.

> There are two possible fixes. One is to read tfile->queue_index and update
> e->queue_index under tun->lock. The other is to have
> tun_automq_select_queue() fall back to reciprocal_scale() when
> e->queue_index >= numqueues. Would either of these work here?

The second one covers both sequences and keeps the write() path
lockless for a known flow. It would be a separate patch for net-next,
since the race is old and has not been seen in practice.

  reply	other threads:[~2026-11-14 13:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 17:42 Umang Pokhriyal
2026-11-06 16:27 ` Willem de Bruijn
2026-11-08 17:02 ` netdev-bot+sashiko
2026-11-14 13:21   ` Umang Pokhriyal [this message]
2026-11-10 20:40 ` patchwork-bot+netdevbpf

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=20261114132237.70664-1-umangpokhriyall@gmail.com \
    --to=umangpokhriyall@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jasowangio@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@gmail.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

all inboxes | Powered by JetHome®