Article View: linux.kernel.netdev
Article #12027[PATCH net-next 0/3] net/sched: get_fill_size() budget fixes for act_gact and act_vlan
From: Linkui Xiao
Date: Fri, 06 Nov 2026 06:41
Date: Fri, 06 Nov 2026 06:41
55 lines
11095 bytes
11095 bytes
The get_fill_size() cleanup began with commit 8e2efb3f45a5
("net/sched: add get_fill_size callbacks for actions missing them")
[1], which fixed the actions the bug was reproduced with, pointed at
act_gact/act_skbedit/act_vlan as the pattern to follow, and left the
other pre-existing issues to upcoming patches. It continued with
commit 4ba61bfd4998 ("net/sched: add get_fill_size() to the five
actions that lack one"), which spelled out the rule the callbacks have
to obey: size every optional attribute unconditionally, because reading
the current flags to size it conditionally races a concurrent replace
that can flip the attributes between sizing and dumping.
Auditing the remaining callbacks against their dumps turned up two gaps
in the very pattern 8e2efb3f45a5 held up:
- act_gact reads tcfg_ptype with neither tcfg_lock nor READ_ONCE() and
budgets TCA_GACT_PROB only when that read happens to be non-zero
(patch 1);
- act_vlan never budgets the two PUSH_ETH addresses its dump emits,
and only escapes overflowing because the three PUSH_VLAN_*
attributes that a PUSH_ETH instance does not emit happen to add up
to exactly the same 24 bytes (patch 2).
Neither can overflow today. All four consumers of the value --
tcf_get_notify(), tcf_del_notify_msg(), tcf_add_notify_msg() and
tcf_reoffload_del_notify_msg() -- allocate at least
max(attr_size, NLMSG_GOODSIZE), and NLMSG_GOODSIZE is
SKB_WITH_OVERHEAD(PAGE_SIZE), so a batch has to carry enough actions
for attr_size to grow past roughly 3.7 KiB before a 12- or 24-byte
shortfall matters. A replace cannot interleave between sizing and
dumping either: RTM_NEWACTION, RTM_DELACTION and RTM_GETACTION all take
rtnl, and the classifier path, which can run without rtnl, computes
attr_size in tcf_exts_validate_ex() and discards it. Both patches are
therefore accounting-correctness fixes against the rule above; each
carries a Fixes: tag for whoever wants it in stable.
For completeness, act_ct, act_tunnel_key and act_pedit also size some
attributes conditionally. They do it from a single rcu_dereference() of
a params pointer that replace swaps rather than mutates, so the budget
stays consistent with the snapshot it was computed from. act_gact
instead reads tcfg_ptype, a field mutated in place on the action itself,
with no lock and no READ_ONCE() -- that is what patch 1 fixes. act_bpf
sizes conditionally too, but takes tcf_lock to do it; patch 1 removes
the read instead, which needs no lock.
Patch 3 adds TDC coverage for the previously untested gact dump and
get paths.
Tested by building net/sched with CONFIG_GACT_PROB=y and W=1, which
produced no new warnings, and by running the tdc gact and vlan suites
(38 and 36 cases, including the three added by patch 3) against a
CONFIG_GACT_PROB=y kernel with this series applied; all passed.
[1] https://patch.msgid.link/20260816201327.2435335-1-victor@mojatatu.com
Technical Details
Message-ID:
<20261106064114.3592670-1-xiaolinkui@126.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-357785-linux-kernel-netdev=dewy.ruShow 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-357785-linux-kernel-netdev=dewy.ru From: xiaolinkui@126.com (Linkui Xiao) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next 0/3] net/sched: get_fill_size() budget fixes for act_gact and act_vlan Date: Fri, 6 Nov 2026 14:41:11 +0800 Organization: Usenet Network Message-ID: <20261106064114.3592670-1-xiaolinkui@126.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3812200"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:DU4B6UJHLlGdACcRXbDVkQqabI0= sha256:UNMssIbJhzLxQEMraMSDUcQPLoG9Izo4Jdtp2D9S/JM= sha1:GmXwc4aEMbP/PXAcMH5B1xzaVoo= sha256:d7CKjEev5JKxYl3S/tJF0ESA6U2Jx4LQI5yHI7+VL5I= 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 2589A113180; Fri, 6 Nov 2026 09:44:21 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.048 X-Spam-Status: No, score=-3.048 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.249, 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=126.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 UeDUnfszvJNP; Fri, 6 Nov 2026 09:44:16 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-357785-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=126.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 348A611317D; Fri, 6 Nov 2026 09:44:07 +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 35BE82CF60; Fri, 6 Nov 2026 06:42:09 +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=1793947329; b=48LhSB4GWuMN+VsNfXVrOIFC7K2e3FBmh3hJRSwmWfHZVjFNLK3Upka7L3DNTFe7zT21 NZK3SVNVvzKbm1P1RlTpzTkkE/a0wqaD2SvvIC68wlMIsG7qYFnIhdqfqBimVz/ZM58JP NeGhrc3XJ0KFlV3X16P7TCrYIIMCLMajzK+HZAUdUH+YrCQJxFBylE/gWEM5eCBHY1NrL LjfOiTtga35hAFRQpk1CBFMa6Ku8yRKONrIZMTgdGFahlpx81S+8FAi/DIhglb5JeFJlj EYC2/4VMAhqFLJRURZ4AfKyx2vqQ6zW8R4sh77icyHbnQQFDxwXU3jfLKOfgAIzOpQw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793947329; 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=SQ426vLxQ2280euxZBJWWN8G4ZPXaNeSNnRUBS0Gfpo=; b=Y+7L4UNeD1y19sEwibruJcPr/bpUZtkh2UxPWK/itlqwjq+6gnBIrA4TMC96Q/ZVs7+9 aqNCeBwhk2IBIFSEfx0OJVJbiHltA3HKhjn95pSOVXKeuxMHjVP3KSa4QZpGDl1Rkj/5O i7eG9jf6VVk3JWpPo+a3hiMSHbpmpI8FhJ7Gx8+aPwAIyqMkMpbbpKMTVBsv9o1YZBu7t 7gR3YHiZU9JuxFW2ZcJkHZIuw8coSogkE7IU+YxsyinBfOhhiaqpBqHXacM6EAtNBqGK4 JRg5PlFFcHr+kNnj4hK4znlLZr5P80QI8LVH+qdunnHf3b57cD81+Brep4wci8Mx6MQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=Kn5xqePs; dmarc=pass header.from=126.com; spf=pass smtp.mailfrom=126.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 08F36606A32C; Fri, 6 Nov 2026 06:42:09 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=Kn5xqePs X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=117.135.210.9 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793947323; b=AV5jFuHIuoS6SQ1I+jYydha1HdMmPv06iHOTo8Fye49TZObPLET98p9o0wucfyd+MlND WON2WlJO6GwLHW/03NjzReBPBdtjlSrPMDKUgk9Q6Gr0gQjG71UU3BygaP2otg/As633U fyb7QMh76CtxvUqA9BcAMWQ4n/9Nmg8ngCjYA1dk7OKeseR7TXA4TWnTz/igj6coM7mK8 mis0ENM/RRyOIf8pwok/svMPSDWFGsgt7mebgXh4bf3agfIHPthmPZ82XPFkB5rlOWx4A 0f2xu0haaWWSsgVFZ7h+GsVVh7APoe3HV820yaTlnqN4lBO65zouTypS4Z2fiW3VtCw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793947323; 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=SQ426vLxQ2280euxZBJWWN8G4ZPXaNeSNnRUBS0Gfpo=; b=VxtWEKu7FwMr6n7x6X/o7JbVj5wjAMrSkgPASws7XEVZAG8MPpHmzCpXFB65qQZYKGfD h/dZ6u9DDoqYr3uKlh+V9kqV+W3qJf6PzN5YqMCzIVodUOLtsqdauBugQY08IOTftEg5U u7lQ6j9uinw282GsSeCmXSw1RcwnzHYkXuQWprE54TVzbsFxt7XzlT7nS+L+uCzd2jJCV aHmSmGvc3kVsiWKc1a8vGhv/CjIE5HMN7Ku0hRdW40P5cEiU0PXEzJ43Fa5f31LO3lwT6 YgUPKa+y/ivIGY6tXXjao8j6JW6+zu5Majv4sI2bR/x7Q6pV44mFYkuchte9PcYua1w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=126.com; spf=pass smtp.mailfrom=126.com; dkim=pass header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=Kn5xqePs; arc=none smtp.remote-ip=117.135.210.9 X-Received: from m16.mail.126.com (m16.mail.126.com [117.135.210.9]) (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 EA779606A326; Fri, 6 Nov 2026 06:41:59 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EA779606A326 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=126.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=SQ 426vLxQ2280euxZBJWWN8G4ZPXaNeSNnRUBS0Gfpo=; b=Kn5xqePs/fZLps/QaP 5E1Nl+0hi4J+S3W/8I2SzKxYkQ4xdFNBbKdQRKDW38b+iIyvdsjNp31UPea4NOYJ hKIQ0zPrznR1BRV1xOhz6/MQCXvbfC7guVQjxXlBcB3E1LlckXEHMgmUk92DcmrW CM+dZSiGZOnnLHvHvK67MLXBo= X-Received: from localhost.localdomain (unknown []) by gzga-smtp-mtada-g0-4 (Coremail) with SMTP id _____wDnR+uMdu1qZ7kzCw--.3170S2; Fri, 06 Nov 2026 14:41:17 +0800 (CST) X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: git-send-email 2.25.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: _____wDnR+uMdu1qZ7kzCw--.3170S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxAFy3Cr48XFyDWF48Zry3XFb_yoW5AFyUpF W3W390kr1DJryxAw4xAw48Xa1S9wsxAFWUWr1fGr1S9Fs5Ww1fAFyrKay3WFyUCws3Xa4j qr4qgrnrWrWvyaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UlQ6JUUUUU= X-CM-SenderInfo: p0ld0z5lqn3xa6rslhhfrp/xtbBqQ7WrWrtdo54WQAA3C