🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #9093

[PATCH net v3 0/2] sfc: fix use-after-free of aRFS work on ring resize

#9093
From: Sicong Huang
Date: Sat, 31 Oct 2026 06:38
56 lines
10860 bytes
This series fixes aRFS work lifetime and state-copying races when
ethtool -G replaces channel structures. Both sfc and Siena are affected.

Patch 1 keeps expiry cancellation inside efx_free_channel() and re-arms
expiry on the surviving channels, including allocation failure and probe
rollback. Patch 2 prevents new insertion requests while the net_device
is detached, waits for pre-detach receive callbacks and insertion work,
and cancels expiry before copying the channels.

Stopping NAPI alone does not stop deferred PTP receive processing from
submitting aRFS requests. The insertion entry point therefore checks
netif_device_present(), paired with synchronize_net() on the resize
path. All insertion work items are initialised once and flushed without
using the in-flight bitmap as a completion test.

Changes in v3:
- Re-arm expiry after channel replacement, including failure paths,
  so it continues without further NAPI polls. (Sashiko, Paolo Abeni)
- Add patch 2 for the insertion-work UAF and expiry-copy race reported
  by Sashiko. Cover deferred receive processing as well as NAPI.
- Retain the original Fixes tag: asynchronous expiry already needed
  flushing before the later change that added periodic re-arming.
- State the discovery method and testing limits.

Changes in v2:
- Introduce efx_free_channel() to encapsulate expiry cancellation in
  the channel deallocation helper. (Edward Cree)
- Add the Fixes tag.

Testing: the modified translation units build with GCC 11 on x86_64,
W=1 and CONFIG_RFS_ACCEL both enabled and disabled. No hardware testing
or runtime reproduction has been performed.

v2: https://lore.kernel.org/netdev/20261023134214.322796-1-congei42@163.com/
v1: https://lore.kernel.org/netdev/20261022133927.3860186-1-congei42@163.com/

Sicong Huang (2):
  sfc: fix use-after-free of filter_work in efx_realloc_channels()
  sfc: quiesce aRFS work before copying channels in
    efx_realloc_channels()

 drivers/net/ethernet/sfc/efx_channels.c       | 35 +++++++++++++++++--
 drivers/net/ethernet/sfc/efx_common.c         |  1 +
 drivers/net/ethernet/sfc/rx_common.c          | 30 +++++++++++++++-
 drivers/net/ethernet/sfc/rx_common.h          |  2 ++
 drivers/net/ethernet/sfc/siena/efx_channels.c | 35 +++++++++++++++++--
 drivers/net/ethernet/sfc/siena/efx_common.c   |  1 +
 drivers/net/ethernet/sfc/siena/rx_common.c    | 30 +++++++++++++++-
 drivers/net/ethernet/sfc/siena/rx_common.h    |  2 ++
 8 files changed, 130 insertions(+), 6 deletions(-)


base-commit: f4377bf85887f57b59abb5479f7660a81ffe4449
-- 
2.34.1
Technical Details
Message-ID: <20261031063823.876645-1-congei42@163.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354036-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354036-linux-kernel-netdev=dewy.ru
From: congei42@163.com (Sicong Huang)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v3 0/2] sfc: fix use-after-free of aRFS work on ring resize
Date: Sat, 31 Oct 2026 14:38:21 +0800
Organization: Usenet Network
Message-ID: <20261031063823.876645-1-congei42@163.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2394470"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:iS23AgbIDSvieCpQ8rhBf76puuc= sha256:wBuZ4KHvlrd8YHi1HYoxfbfc2sDx7OLFR8mBzye5+Ik=
	sha1:HlfM9LOHtJGSvVB/xVQ6qdZ3qjE= sha256:1CVSjHZjemvl4C2AeUjivJ1UTtqfPZB6jqM9ESTHaBs=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 0BB40125CB0; Sat, 31 Oct 2026 09:39:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.047
X-Spam-Status: No, score=-3.047 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=163.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id hi-aFMjzqfiH;
	Sat, 31 Oct 2026 09:39:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-354036-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=163.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id E6094125CB6; Sat, 31 Oct 2026 09:39:32 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 4426429D8F; Sat, 31 Oct 2026 06:39:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793428758;
	b=eei2lHsxhDOUwt6MgG02o/CZ/tKZccq5Aa1CYlsky5p19d7VdR9p8nQk24d+GUoT15Dt
	 rF7a0drMlqRYLGs5C6J91BBXZHh5cj8/VZQVD8uusXua0sbIpm0fRKsD79J0QcGo4pBn6
	 MCJp2Q+IXNn07zeO2b59RKVfg3A1LMS396TlwrpknMnM4WpR0T9r6uZeOdGyETeEVMAYC
	 VwGl2KORNY1N+0Fus4gcnkpXS4qEKa+cqsmPAspLxJl56G5xlhnhYWhpj1jefUlnlWKbC
	 lVfcEK5EgBVhS++YTacIpnGp8lANALOeZyI49MBgFtKqrll0B6eMIfDMRejVwJUiI/w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793428758;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To:
	 Cc:Subject:Date:Message-Id:X-Mailer:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Transfer-Encoding:X-CM-TRANSID:
	 X-Coremail-Antispam:X-CM-SenderInfo;
	bh=0SM17f8ws8GU5qkZSgnLS65xQS+fCq9gj/D+AFbizlw=;
	b=e6RN7rPz3xTYoQlgq+nJU69ZShJHdZaG7kg9GckvfwAv11LFzT5mfT1+E6z+nbO28Q4h
	 z4zV47sTMZxFkH+4Pw27H2c1plGdBlIe9qmmUWz6NuIgxgyMUccdYHETVkiCnEnj66hMu
	 z5kZ9Zm8x9gQqRyQg/vMY0zeVHcURicVGNskIBRwYQrrh1vyH7QTBykj4rwvHwhABvg2w
	 vy/C7PN5tyNo+fMjZBu1NQcCjHEjz2xo+Pj5wG+/Gdd0vkgEIzzn3bFROSPgHXNBM49je
	 gPQNSmD8bzWie1+D3JkPZRpBWemWSFY96gGnfj0QKAP2430SC1erKWVsFMFgBUnSpPA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=H7dYOwrR;
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 95294606A327;
	Sat, 31 Oct 2026 06:39:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=H7dYOwrR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.4
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793428747;
	b=NMhTAR1YaP+HNGwfncgHHBcNpEj+BFcbbAtYJoNFSy5nRb6sR9yh5UvNaV6eHFeu07wA
	 dzA2SuFXN3xCAscg5p/k38aD5zr80G57KQ0GEk391X6Y8ysZIAKr7gTaPuVWjwxcZCHUU
	 gUqsdGBbAyNxHGlMRNnd3hHBBUiWUdE0fFHqm119uW+RvgT24rknoALDN/yYgRjXio5es
	 P66U9xbF1LN6uur/9Q70WFoZWUZfSe4Yd3MZvvmFSp+bOAIYTjb3L+gqhzVMcIzzfKCJG
	 4K9fK5maNdTJeeap/+veIQVu5TT3yLG8o05TQCeuHe6PQyQWHUougZ/kmopVLLXhUPA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793428747;
	h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date:
	 Message-Id:X-Mailer:MIME-Version:Content-Transfer-Encoding:
	 X-CM-TRANSID:X-Coremail-Antispam:X-CM-SenderInfo;
	bh=0SM17f8ws8GU5qkZSgnLS65xQS+fCq9gj/D+AFbizlw=;
	b=yIcDl804LuEJXzApKE4lbX4E9G4qyQv7mtNJKmcpJGgRLeqqkNZHMDtTrUKblyPQ8hOr
	 EB74rrZbh+qCdm8sDVuEwxVqVi0UubhZYVsC9JtO17Q2LTqpHh3TRBjbb+7JF+qn6ZZNf
	 /QH3GkRp1njFGRzzpKbxAIHyQMRaYB5fWKlLJqfmiYQzgnYfQrnVYuBlQBsV7hg5Vyz5c
	 h9vEXj+9WcHgwlzPyDaYwjz9WAerwBtAVD4YT/sjZ6LoLHWpCrVYKz/2mm5kOo74aigxL
	 DR0QVVBb5Xh5pF0N4LzApHqKxEMnEFowW4bvMmmweMJU0POkXmeBkYzZgbrWatSEuqw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=H7dYOwrR;
	arc=none smtp.remote-ip=220.197.31.4
X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EFE2606A31C;
	Sat, 31 Oct 2026 06:39:03 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9EFE2606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;
	s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=0S
	M17f8ws8GU5qkZSgnLS65xQS+fCq9gj/D+AFbizlw=; b=H7dYOwrRorkXAfm5yv
	rLwKSwJLFSosuNLG9vO9TL2Vu0LALDZnq1P4YcZW+zsUxD7KQPdN/L7eXoPwQYfm
	kIZOm74hLP9nYwiQt8jAH965el6k85nog6SdYYkenV8dTenY1+McaM6SkddN+3qu
	ucTz0XK/7DoBT7q1a1jkNW4i0=
X-Received: from flipped.. (unknown [])
	by gzga-smtp-mtada-g1-0 (Coremail) with SMTP id _____wDXv9jfjOVqDwKbDg--.29841S2;
	Sat, 31 Oct 2026 14:38:24 +0800 (CST)
X-Cc: ecree.xilinx@gmail.com,
	andrew+netdev@lunn.ch,
	davem@davemloft.net,
	edumazet@kernel.org,
	kuba@kernel.org,
	pabeni@redhat.com,
	kees@kernel.org,
	linux-net-drivers@amd.com,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.34.1
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-CM-TRANSID: _____wDXv9jfjOVqDwKbDg--.29841S2
X-Coremail-Antispam: 1Uf129KBjvJXoWxuFy8AFy8KFWkXFWrCr1xXwb_yoW5Gw18pa
	y5A3yYvr18JFy3K3Z3Aw48Za4rAF4fJ3W5Gr1ftw1rZ3s8AF12kr4rK3WYgr4Utr47Xw4a
	vr1qvrn8CF15A3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07joUDJUUUUU=
X-CM-SenderInfo: 5frqwvrlusqiywtou0bp/xtbC1AJvYmrljOIkXAAA3C