All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Robin Jarry" <rjarry@redhat.com>
To: "David Marchand" <david.marchand@redhat.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>, "Stephen Hemminger" <stephen@networkplumber.org>
Subject: Re: [PATCH v2 1/2] net/tap: fix FD leak on netns change
Date: Fri, 06 Nov 2026 12:28:26 +0100	[thread overview]
Message-ID: <DMO3CD4MJZFH.1V9HO1S49IQ1T@redhat.com> (raw)
In-Reply-To: <20261106085701.2429186-1-david.marchand@redhat.com>

David Marchand, Nov 06, 2026 at 09:56:
> When a tap interface moves to another namespace, tap_netns_change()
> calls tap_lsc_intr_handle_set(dev, 1) to recreate the LSC interrupt
> without first tearing down the old one. The previous LSC netlink
> socket fd is never closed.
>
> Defer the full LSC teardown and re-registration to an alarm callback
> which runs in the interrupt thread but outside any active source
> context. The alarm switches to the device's network namespace, tears
> down the old LSC handle, sets up a new one (opening a fresh netlink
> socket in the correct namespace), restores the original namespace,
> and forces carrier state back up.
>
> Extract tap_dev_ns_switch/tap_dev_ns_restore helpers to share the
> namespace switch logic between tap_netns_change and the alarm.
>
> Fixes: aae3a38e9e03 ("net/tap: detect namespace change")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Robin Jarry <rjarry@redhat.com>
> ---
> Changes since v1:
> - moved pmd->if_index clearing before trying to change netns,
> - moved alarm registration after netns changes succeed,
> - added second alarm cancel for unregister race with netns change,
> - ignored ENOENT suggestion from AI review,
> - added error logs to please AI review,
>
> ---
>  drivers/net/tap/rte_eth_tap.c | 99 +++++++++++++++++++++++++----------
>  1 file changed, 72 insertions(+), 27 deletions(-)

Tested-by: Robin Jarry <rjarry@redhat.com>


  parent reply	other threads:[~2026-11-06 11:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 17:17 [PATCH 1/2] net/tap: fix FD leak on netns change David Marchand
2026-11-03 17:17 ` [PATCH 2/2] net/tap: fix use after free on interrupt handle David Marchand
2026-11-04 10:31   ` Robin Jarry
2026-11-04 10:31 ` [PATCH 1/2] net/tap: fix FD leak on netns change Robin Jarry
2026-11-04 12:21 ` Stephen Hemminger
2026-11-05 14:45   ` David Marchand
2026-11-06  8:56 ` [PATCH v2 " David Marchand
2026-11-06  8:57   ` [PATCH v2 2/2] net/tap: fix use after free on interrupt handle David Marchand
2026-11-06 11:28     ` Robin Jarry
2026-11-06 11:28   ` Robin Jarry [this message]
2026-11-09 18:19   ` [PATCH v2 1/2] net/tap: fix FD leak on netns change Stephen Hemminger
2026-11-10 10:03 ` [PATCH v3 " David Marchand
2026-11-10 10:03   ` [PATCH v3 2/2] net/tap: fix use after free on interrupt handle David Marchand
2026-11-10 16:54   ` [PATCH v3 1/2] net/tap: fix FD leak on netns change Stephen Hemminger

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=DMO3CD4MJZFH.1V9HO1S49IQ1T@redhat.com \
    --to=rjarry@redhat.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.