From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B5FAF48962 for ; Fri, 17 Oct 2025 17:59:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A404C42DF0; Fri, 17 Oct 2025 17:59:44 +0200 (CEST) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id 5D2A642DD6 for ; Fri, 17 Oct 2025 17:59:42 +0200 (CEST) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-7833765433cso2873333b3a.0 for ; Fri, 17 Oct 2025 08:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1760716781; x=1761321581; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=2jHunm+1/i/udJXQm8cqdA59qcWhqQRnXtCB4jwFriI=; b=xGTt6Rf6emC4bL+CSj1a7FHIaMjO3mQpaAmFGyiVGaybhQxuzpX9eLJlAJkYaHAkZj QwTrlEt4sJ7qGTVm54RSqwpmMgVespWFeLIPE+bizMF07mivgzJEiDxY+RHj/b6x86HC YQwJJP73L0JSFuqacWen4jLkNT+ZnDIKtB0zPVQXJGUj/IowCs+BoUqqeufEZTCyfi5H VEr1o3M92n4uj8X9qypr04xhZdhJFP+VDLNZLah9SYfyLJAIh3YbXIWjrlV28R8mdQPV qRQJnekv7PNQDpzTGd1DH36tAdYMHw/BqEyltie4Zh7OpcQe4L7LB5FTHbrob5K487OM OzwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760716781; x=1761321581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2jHunm+1/i/udJXQm8cqdA59qcWhqQRnXtCB4jwFriI=; b=AlKUDIaNOvMBOxxV2bV6S1Oir+bQdHcAnbDo3xuwG0IzIrRTELgqAHI9ua5LCsi/Ad 124KJMh8mCm6AgFKH+MjrFjRB12LaQhqU0TY2DR1FInmfWAjaZ4Bz1TOm/56UWm37DPf D7twbWnbUt/6uZ3qIzlrmI7z//jJiGxes0mj9ESZikCM06eHIUWriuOC+PikTTCL80Zt fywNsmiWorjPQvBlZTXM41IkNQM5F91me7Gh03YLhV8cXXOmgH33LTrMJbVKr9veNBD8 KQT+XViDxN6O9RMRpBtAL9zfE5alVuqC2bsvr799ET7j+O80oZxEAG8l8AcfapzQL9mp /nUg== X-Forwarded-Encrypted: i=1; AJvYcCXcFkZvThaoLXGZ1PhXbhUCBYhYbDEDx/ft9L6+kRCiRQDFqSAMcRpA7Q7U/3f+S5DgB9lK/u8=@dpdk.org X-Gm-Message-State: AOJu0YwgWWbOLz8/lkC0lk/rOvP7tFbS3/D300OH66L2dNeGckG4Cpo6 ZrphqiLtuIDZ1+ZhgfPZ5rzK0L/vgWXBR2iVkR9KOlFySj6drhhMWIDUNk8yNaOtcq4= X-Gm-Gg: ASbGnctE/A5/jcLv8b74bHC3nmFxmnMlX5gzVRM+c/4xkWb6tUaJqr7Uu3Ot4VblmQ4 Pgbzut4OPG1moHflHxPU1/tLglKwKg2Rh1xLBjwfbpj45RffpWJIVX+nWmJd4q0p2+QcU6v0Bbu MLLljZVGsrjPKc3eeUrwW0Dk6t3wj3B+IvG0QOBuSUAla3Qp600LUaff+NgHT63ZlG6UbA15zdY N5jOeL3gxJrsCl4IfQKO16dEADRlhN54Tbn/+xARN/eRInmnMz65AkCCgxVtIBRFRS6ETu7mSmW ATrYj+QKQomlvq2eZm3QMxJxKJsihgLMmGXRTpxrG7h/T+q0zFVam3H4s1RyS+e/9+eXsYm9c+6 BqTXuHVM/mL1Z72BFXiHOMP3Cpjo2PL7CDKXvQ8bDoxVSrSjIfv24MVO+3kQusURhVxiMdziEgI q4/UMEBFO7jv4wqqF70UDqz4hqmzJnf6NqLWkX+HDCoAeMcWFCaQ== X-Google-Smtp-Source: AGHT+IF3iIOxjG845txy0W2T+Tzm9BchKwNUYd2YXZ7gmm1LwDgDHOlCoGmUh+sUSgenbRFmXy9Xxw== X-Received: by 2002:a05:6a00:2308:b0:792:52ab:d9fe with SMTP id d2e1a72fcca58-7a220440d9fmr5096306b3a.0.1760716781296; Fri, 17 Oct 2025 08:59:41 -0700 (PDT) Received: from phoenix.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7992b060a38sm26542041b3a.5.2025.10.17.08.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 08:59:41 -0700 (PDT) Date: Fri, 17 Oct 2025 16:38:54 -0700 From: Stephen Hemminger To: Robin Jarry Cc: dev@dpdk.org, Keith Wiles , Pascal Mazon , stable@dpdk.org Subject: Re: [PATCH dpdk] net/tap: fix interrupt callback crash after failed start Message-ID: <20251017163854.2bd86108@phoenix.lan> In-Reply-To: <20251017121946.421658-2-rjarry@redhat.com> References: <20251017121946.421658-2-rjarry@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Fri, 17 Oct 2025 14:19:47 +0200 Robin Jarry 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 Queued to next-net