DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Robin Jarry <rjarry@redhat.com>
Cc: dev@dpdk.org, Keith Wiles <keith.wiles@intel.com>,
	Pascal Mazon <pascal.mazon@6wind.com>,
	stable@dpdk.org
Subject: Re: [PATCH dpdk] net/tap: fix interrupt callback crash after failed start
Date: Fri, 17 Oct 2025 16:38:54 -0700	[thread overview]
Message-ID: <20251017163854.2bd86108@phoenix.lan> (raw)
In-Reply-To: <20251017121946.421658-2-rjarry@redhat.com>

On Fri, 17 Oct 2025 14:19:47 +0200
Robin Jarry <rjarry@redhat.com> wrote:

> After moving a tap linux net device to a different namespace,
> tap_link_set_up fails with an -ENODEV error. Indeed it relies on an
> ioctl call using the interface name as argument:
> 
> 	/* with ifr->ifrn_name = "dtapX" */
> 	ioctl(pmd->ioctl_sock, SIOCGIFFLAGS, ifr)
> 
> This causes rte_eth_dev_stop() to do nothing since the device is not
> seen as started. And then, when removing the device, the interrupt
> callbacks are left there.
> 
> If they are invoked, they will be so with a "freed" device pointer:
> 
> Thread 2 "dpdk-intr" hit Breakpoint 1, tap_dev_intr_handler
>     at ../drivers/net/tap/rte_eth_tap.c:1689
> 1689            struct pmd_internals *pmd = dev->data->dev_private;
> (gdb) p *dev
> $2 = {
>   ...
>   data = 0x0,
>   ...
>   state = RTE_ETH_DEV_UNUSED,
>   security_ctx = 0x0
> }
> 
> This causes a crash when dereferencing the data pointer.
> 
> When tap_link_set_up fails, ensure to unregister the interrupt callbacks
> that were just reinstalled.
> 
> Cc: stable@dpdk.org
> Fixes: c0bddd3a057f ("net/tap: add link status notification")
> 
> Signed-off-by: Robin Jarry <rjarry@redhat.com>

Queued to next-net

      reply	other threads:[~2025-10-17 15:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 12:19 Robin Jarry
2025-10-17 23:38 ` Stephen Hemminger [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=20251017163854.2bd86108@phoenix.lan \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.com \
    --cc=pascal.mazon@6wind.com \
    --cc=rjarry@redhat.com \
    --cc=stable@dpdk.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;
as well as URLs for NNTP newsgroup(s).