Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D08E408028; Wed, 30 Sep 2026 19:35:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790796959; cv=none; b=RIWebj2+iIBO9ZWue0arLs0PnHnBSKpun83razmlbhTOArZROxMM1IvrN81xhyGXvcm3/33+dFUYO3BE3EaqkuXbXPplVP98u5LpK6bn1xha2WtB1CxC8K9ule+yFhbUStJ3YQGDq6gu1loOki0l6Q7ybd4GuYWZbkspGjIEN6I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790796959; c=relaxed/simple; bh=P2fmeolH06LQGfo9jSUJeIMoxwfsfgBY5fTYmdCTrg0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sHWbVIn2K01lBg+tv/SeFpKvUWS2Q9AJm72ZfqxWtbIg47zqKBnMJCs7Nw55il4dn7jiWIF4v+1KcHZ+WHUUYUMZNUEZCZCcnCGK4KrgUy+UAxTzrKIqoPk0S8Bku4bzYh4q9hT64ZVCiJzfnjkx/RQ0+kQ4MxsdOrosN/nrJnA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DDFreTFX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DDFreTFX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63DD51F000FF; Wed, 30 Sep 2026 19:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790796957; bh=mb8qhJktE0oL64i/YxpJSTbkmqbVlHLiPmZhIlLQS6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DDFreTFX9PzMSHTRYOq7Prs/8mGkvfvi/otQWi19Y2mfeMIqoSm2dS1lxHt45wTVJ 0vxN8V6UigEti1lG/KVrHqbWfE62UF6qjP14WcmTFp/96VfVORnfrXqWQGRFGz5qrh 7LWCb/XsmUj1iORK8mVmXpKGe5hzK+O8qy57xE6o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Weiming Shi , Stanislav Fomichev , Jiayuan Chen , Jason Xing , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 1052/1193] veth: manage XDP program pointers during channel resize Date: Wed, 30 Sep 2026 17:28:56 +0200 Message-ID: <20260930152457.596231275@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jakub Kicinski [ Upstream commit 7104a370714346b667712913dc16abf14bbc97ed ] veth_set_channels() tears down XDP resources for removed RX queues without clearing rq->xdp_prog. If the program is then detached or replaced, those queues keep the old pointer after bpf_prog_put(). A later channel increase can re-enable NAPI and run the freed program. BUG: unable to handle page fault for address: ffffc90000256048 Oops: Oops: 0000 [#1] SMP KASAN NOPTI RIP: veth_xdp_rcv_skb (include/linux/filter.h:779 include/net/xdp.h:696 drivers/net/veth.c:820) Call Trace: veth_xdp_rcv (drivers/net/veth.c:941) veth_poll (drivers/net/veth.c:986) __napi_poll (net/core/dev.c:7787) net_rx_action (net/core/dev.c:7850 net/core/dev.c:8007) handle_softirqs (kernel/softirq.c:645) Kernel panic - not syncing: Fatal exception in interrupt Fixes: 4752eeb3d891 ("veth: implement support for set_channel ethtool op") Signed-off-by: Weiming Shi Acked-by: Stanislav Fomichev Reviewed-by: Jiayuan Chen Reviewed-by: Jason Xing Link: https://patch.msgid.link/20260921231856.1798630-1-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/veth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index f34f4b24fbfd2..e5daca818c702 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -1075,6 +1075,7 @@ static int __veth_napi_enable_range(struct net_device *dev, int start, int end) for (i = start; i < end; i++) { struct veth_rq *rq = &priv->rq[i]; + rcu_assign_pointer(rq->xdp_prog, priv->_xdp_prog); napi_enable(&rq->xdp_napi); rcu_assign_pointer(priv->rq[i].napi, &priv->rq[i].xdp_napi); } @@ -1109,6 +1110,7 @@ static void veth_napi_del_range(struct net_device *dev, int start, int end) rcu_assign_pointer(priv->rq[i].napi, NULL); napi_disable(&rq->xdp_napi); + rcu_assign_pointer(rq->xdp_prog, NULL); __netif_napi_del(&rq->xdp_napi); } synchronize_net(); -- 2.53.0