Article View: linux.kernel.netdev
Article #6464[BUG] net/sched: cls_fw failed add changes live filter state
From: shaos
Date: Thu, 22 Oct 2026 14:47
Date: Thu, 22 Oct 2026 14:47
33 lines
10901 bytes
10901 bytes
Hello, A rejected new-style filter add can leave a new fw_head and its request-supplied mask published in an existing legacy cls_fw chain. On Linux v7.3, an optionless legacy FW filter first creates the tcf_proto. A later add supplies a non-default mask and a nonexistent ingress device. The request returns -ENODEV, but the mask remains installed: a subsequent otherwise-valid default-mask add returns -EINVAL, while an add using the retained mask succeeds. The same failed request also changes the existing datapath behavior. In the reproducer, packets previously classified into the configured prio class instead enter the default class after the rejected request. A clean control keeps classifying them into the configured class. HEAD commit: c03c1a14507dfaf8b856c2608f9ac216021fc222 git tree: 30fd2ef82912c26cf3a58ad0ba6afc375fa851ac source version: Linux 7.3.0, local master compiler: gcc 11.4.0, GNU ld 2.38 console output: https://gist.githubusercontent.com/shaos26/031126b2aeea4add6fe9fb8c7d9f36f7/raw/038fc0766949ae6025e04308b63e3ad065a02e53/console-output.txt kernel config: https://gist.githubusercontent.com/shaos26/031126b2aeea4add6fe9fb8c7d9f36f7/raw/96fd3ada617c0f89dc344f7bb650b0818c480e65/kernel-config.txt reproducer: https://gist.githubusercontent.com/shaos26/031126b2aeea4add6fe9fb8c7d9f36f7/raw/c49340adda66fae59de716c352f915c8738e947b/poc.c initramfs init: https://gist.githubusercontent.com/shaos26/031126b2aeea4add6fe9fb8c7d9f36f7/raw/5dcb67be6b9905a0b466bc98dd73369ade7dc6e4/init reproduction notes: https://gist.githubusercontent.com/shaos26/031126b2aeea4add6fe9fb8c7d9f36f7/raw/fd147fa4b5dd1c4fa1b0831993137b1ff57f4529/reproduction.md Build the tested kernel with the attached configuration. Build poc.c as a static binary at /poc, place it and the attached init in an initramfs as /poc and /init, then boot a disposable x86-64 QEMU guest with a serial console. The default mode reproduces the retained state; challenge_mode=datapath and challenge_mode=datapath-control exercise the packet-classification effect. Impact and prerequisites: A failed filter-add request can silently alter live classifier state and packet handling in that network namespace. The operation requires CAP_NET_ADMIN in the target network namespace. No privilege escalation or cross-namespace effect is demonstrated. Validation: Two fresh positive boots reproduced the retained mask, close controls passed, the datapath positive/control showed the class change only after the failed request, and a scratch rollback kernel passed the fixed control. Thanks, shaos
Technical Details
Message-ID:
<20261022144749.64372-1-shawnq1@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-350619-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-350619-linux-kernel-netdev=dewy.ru From: shawnq1@163.com (shaos) Newsgroups: linux.kernel.netdev Subject: [BUG] net/sched: cls_fw failed add changes live filter state Date: Thu, 22 Oct 2026 14:47:49 +0000 Organization: Usenet Network Message-ID: <20261022144749.64372-1-shawnq1@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="234717"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:pGXOANtvoFzwQRniqTxtiJQnGEA= sha256:9cV7eIqaNkF6EZmgjSjXL+OQR7H4VkvVlXotRq+Jy2o= sha1:OvtpztCS82mLzEx5iueAnj50MIo= sha256:X2kWp8C0WxEGL5o5Kxd6V/lO8wihvuzQKurCkPxPOdA= 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 784D31112AC; Thu, 22 Oct 2026 17:50:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.146 X-Spam-Status: No, score=-3.146 tagged_above=-9999 required=6.31 tests=[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, URIBL_BLOCKED=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 Cwb947RN2DAw; Thu, 22 Oct 2026 17:50:39 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-350619-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 4D9701112A6; Thu, 22 Oct 2026 17:50:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 7F49760E8F5; Thu, 22 Oct 2026 14:49:07 +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=1792680517; b=jNq37JM3qhZ5mT3obdv/SE/AiQMv6mT9gJjZ6qTb+M+Y8Xn0oa2cVICYpU4A+1HJbASN xhdeWMlnKrrIHnqJM7s3pb1GvInBqeE0BT6iKaJysCSJVRKVYYyubxyVYhPEkK1EKHi9L wjWZJCDHFykead3K1u5yx62UhiJJeSy61/qWLOTgWyj6m79lN7l1ccy3Z1F+1oFOqurU1 tKaOcDGaZttIYvycm9DT6RlYE/Wv5WZGZbY6RQwq8Y4BX0E6IokEDLtMODKmB5GMf3R+L Wisu63RYt0ALfQUGqRPLJrn97hMxlrdvackYfxm5/MbMRX1oE2P16srKdBoGswuEH5A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792680517; 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=TZEMgCC4lPFe6Aq4pxV9q2m4PTyaJp/mWSH9KsdvZtk=; b=DL3eNe3Y/9cncYwT519IiywZ046jCXevO37LP3VVvV0daLFan+Gd7/Tqd4O1NFcMKePj ZYzZ7FFwXNEVe+fyzhp5VONqG08EzehcYHx9cw9aUGFlai8AGYDOoJIfFBP5PYT1rT42K ENu1oMfZojG926veZOT2lmwbYVdze7PY/B2AOQFUbbB6QZ512X7ulFbrkkK+zKib6v/Ye rqzMbWy0EyS45NVfCF2/CY/wTx2Z86wiu5uUBHaEajLOoYLK/XeI3WJgqyPIyANp6VmBY hVIfdxtvQW00xGDSg2XBtMEcXR5J3kuLmZ9HEf2dJuA47puAnfhrJtsu2TnTAI69LqQ== 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=gqWwojbA; 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 C3E7F606A328; Thu, 22 Oct 2026 14:48:37 +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=gqWwojbA X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.3 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792680506; b=bUWY6Z0/Srijbb6Cvk3azQhbBqXE/SuAXhP/BYk1uOaCimTsvcGEfInGbmIKgFvt8Zg4 bvFbrmbl9aOJ4gJz6vFIXAwdeOqEEjkEvXFfWvMkgKETU3Hk6QEDpspVD/Qbs5vBOAJ19 B9iWLfg0DB+pRaCQP/Ambs1CiiHubq9IDKnNBKx93c2FiXzQaw1+2SIOOVFITR6AYoNFX hxt6Qr4SSNLCr+oqxkPufSCWKa/AA/WV1+OwfeBTx84ZaSeGP88D7XUV9Va0J/huE+Dax edH3HYchEWC/43lfr3Kg616c+uhCfLvPOyzjm/PThxZNZJbzmIZ2Hp/0D65CMcl4++g== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792680506; 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=TZEMgCC4lPFe6Aq4pxV9q2m4PTyaJp/mWSH9KsdvZtk=; b=DRvUtwnXYERZUsFZxy1lVUcWZK+4wM2ocNQV7DVojHa1fLsHVAQ1cPu8YH7JfFmGBHKJ udPgElIiMwYX0CXJ8/tWXJ31rvAXABYmZHRquw1d3vFvWqBH7QaDVEhYWPqgL19iwoCR4 W0VZa/FwjXoF1hfjoeY6VT0dP2W+QoQL2c318gJZOVf3mOJaTGoh75YvJynakiGPAYk+S B8Dda2rpYfvtDrm/biQB4FaYHy/bGgr4G2y2EBb8SJX6nisLgx+8+LVkRHZqXX8fomE++ dPo9efSFyiCBmVvaQtvOasnJUWBka2Dkqu0jZFM7ro4XrbsP4eP5xMRmfFzX8dkvZ4g== 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=gqWwojbA; arc=none smtp.remote-ip=220.197.31.3 X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3]) (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 CEAC7606A327; Thu, 22 Oct 2026 14:48:25 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CEAC7606A327 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=TZ EMgCC4lPFe6Aq4pxV9q2m4PTyaJp/mWSH9KsdvZtk=; b=gqWwojbAMZTbS/3MI3 zUPFIc/ZEtZMtvaopSf3o/cu19LR7DS0df1F99sKJBqqK9pe/aomrF8K2ZHXuqPz rvbDjXW6DGsC2IN8dA03WRpeOhJjTK5Izt56UEYDLEX6fyuYyQ6DG8b+0eHwzVME macLBVPENL6Fn55CODWl3njmA= X-Received: from shaos.localdomain (unknown []) by gzsmtp3 (Coremail) with SMTP id PigvCgD3ZS8VItpqBITBBQ--.46459S2; Thu, 22 Oct 2026 22:47:49 +0800 (CST) X-Cc: Jiri Pirko <jiri@resnulli.us>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, netdev@vger.kernel.org, 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: PigvCgD3ZS8VItpqBITBBQ--.46459S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxurWDtFWkuryUtF1kJFW5ZFb_yoW5Xw4fpF Zaya4akF4DKF45tas2kFW8X3Z5uws7Cw45Jw1UWry8Za9xGw1qyw4Ikw13ZFWDArW8Wayr Zrs0qas7Ww4DZaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jo89NUUUUU= X-CM-SenderInfo: pvkd40jtr6il2tof0z/xtbCzxXe7GraIhXKkwAA32