🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6484

[BUG] net/sched: failed RTM_DELTCLASS clears binding and makes retry succeed

#6484
From: shaos
Date: Thu, 22 Oct 2026 14:48
27 lines
10054 bytes
Hello,

A class referenced by an HTB filter rejects RTM_DELTCLASS with -EBUSY, but __tc_ctl_tclass() unconditionally runs the reverse binding walk. The filter binding is cleared despite the failure, so an identical delete retry succeeds while the filter remains configured.

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/6621bf128af29e1959e1040ab721e8e4/raw/7b5cbc2be7590c9773c8c1245c3e03649b10a21d/console-output.txt
kernel config:
https://gist.githubusercontent.com/shaos26/6621bf128af29e1959e1040ab721e8e4/raw/28677abefb68039a69abe240b0770567dac89348/kernel-config.txt
reproducer:
https://gist.githubusercontent.com/shaos26/6621bf128af29e1959e1040ab721e8e4/raw/c69106d421daff43d46c200ae3e1d341cac56769/poc.sh

Build the tested kernel with the attached configuration. Run poc.sh with iproute2 tc and CAP_NET_ADMIN in a disposable network namespace (for example unshare -Urn). It configures HTB, a bound basic filter and two identical class deletion requests.

Impact and prerequisites:
A privileged network-namespace administrator receives inconsistent control-plane results and can remove a class through a request that first reported failure. Independent HFSC and HTB reproductions exercise the same generic sch_api.c path; no privilege escalation or memory-safety issue is shown.

Validation: Repeated fresh boots showed first delete -EBUSY and second delete success. A source-patched control kept both requests at -EBUSY; no-filter and explicit-unbind controls passed.

Thanks,

shaos
Technical Details
Message-ID: <20261022144827.67604-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-350628-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-350628-linux-kernel-netdev=dewy.ru
From: shawnq1@163.com (shaos)
Newsgroups: linux.kernel.netdev
Subject: [BUG] net/sched: failed RTM_DELTCLASS clears binding and makes retry succeed
Date: Thu, 22 Oct 2026 14:48:27 +0000
Organization: Usenet Network
Message-ID: <20261022144827.67604-1-shawnq1@163.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="239280"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ZtLfhK5BwOgFebzuynVb24+8/Lk= sha256:02q7q5giIhuc8YWII5K66Z+nfAGVjQOe9CuX4VQhar0=
	sha1:QXV9OxgBvLQSoqpyGh+x6ZuzYak= sha256:DyfNQNb4ocMdX7st1keRf9K+dvhzFtcPWUKAgzl9GDY=
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 1D8A31112C3; Thu, 22 Oct 2026 18:03:55 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.046
X-Spam-Status: No, score=-3.046 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, 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 PqAFPPPiDb6c;
	Thu, 22 Oct 2026 18:03:51 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-350628-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id D81CF111267; Thu, 22 Oct 2026 18:03:40 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id C9D97327AF; Thu, 22 Oct 2026 14:50:14 +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=1792680541;
	b=3EzMY7PbICQQjkauQC4y/SkoxPQZH+WhT2IMXmjyahJNXmQzQJPeN3TtFJdGvvULt817
	 2LMDI8vxAUnkzoFKH2MHwdLiYH3tF78PgcGDqSsSR82yY3t4y4GXi5mwbY8aWDdFHvGk3
	 AH1MPJpipIzlt8oKkI0adosuJc9cvY6j1S85luukeuQT7gpKJUNlYHqqdhwMgeOAHp7Ur
	 Xc6X9xYiR9JjpKOP4m3RtDsdbeJYnY/xXmTfVR9a0GBeSgbU1F6foLQF2IK3kCxVRjxyZ
	 6JnTOD0t4mnQAQV1zN4zOnwMKWlIdOTRmTB9gS16lgeMtbk4QZ2jdwOEQqiU7qy6sBA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792680541;
	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=GKi/ofm15B962rnTZ6pz7sBCLjR4QVY0SWHqOf6JCUk=;
	b=AIpTHsXs4HGSBwldI42u1PGFcrJJ9Uz2wfQtGe7Kj/Gf27kr83LZDvhYGyiPqEdKa9pS
	 GhdmZ7/tjb5zrSK5yRPl5qdnrQDkDSAsG0ubbsXjCdgVA6/J7K18JfgM9V1SEMf3soF5V
	 iQ+jbwY4y7IWJjMrylHrAfv/ZcZ7DX+IQ1yIA/lfkVk0ffGYsLYVsOAoR2DhgeS6Fvv8M
	 HCYPYqtU7rnmy9rhKd3gAsP4DkusHEMUKv0OmYBJhJ9F3uaFd9LAuQNZtisTrHKhN6MIy
	 GkTQxARkwcLtaTHxZWJJnVpXxqsvEe9U9oC3YnRtN6Cbv6hspCSnqXEAVOgObfN0xwA==
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="KD+/7fdb";
	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 9674960A3815;
	Thu, 22 Oct 2026 14:49:01 +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=KD+/7fdb
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.2
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792680540;
	b=3POpmnwi6e4BQHC8NKz0xqoHYlTVGJuDB5LooipWGmUL6ukOBE8cA3mlb98beEGEO/5C
	 9TlnAXswdC+ZhsdMR7hKuDpfVcX5bg3GYJrQN9z3av+7kCRQNKGOa0i1WO5LgMbDJS5D2
	 sY0w5Jp6muTPeeha4+tLDxCJL1C/J5YQNP50XsE1V/I/kZth9j0AjYqzpIV1bNQl/ihp4
	 feXGfqXAhhZqmAwGXjkSd3HqFsi40rF35xULYM2wUpjF2fmGCgTTmaYzCnw2Sgs+PxSL5
	 KeDw0mxHxghuPlmiV8bZ1x7D+uMZhl1tVLVK88YH/n6UgdXUcOrYGnN/ujVE5lV38Cw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792680540;
	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=GKi/ofm15B962rnTZ6pz7sBCLjR4QVY0SWHqOf6JCUk=;
	b=pFbprEADbFhYkvEUw2x+yxge+JnEJM0MWPqNdvuwzmCx1jANG6C61p4V+tY2dT1mTJ/V
	 r0oKiiR5A/i5s6fT3pSU/LwgOahaBCLmafpYw9R3K3A9WZeQhRpvB6SHxvmELkOZqL8Rg
	 7P8Vb2dE8jz2bS0Pog9u+hxD/B+tSm+ZJbfHC6abH1M5ITsk60r7hyBKTAdWQPlBJOlv4
	 MYNiJ5QlM6IeLLIG9WqPBMilkVCJoYzhWb2gSOyKu3mgLIzVEoY0wDnyhVTZ59ajT/RiH
	 jMLEvJUEOg1XjLRjXX5A2f0FQa8UdFziwwElFtv1Do3/U+zDyD2dskmHC34CaiK/7rA==
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="KD+/7fdb";
	arc=none smtp.remote-ip=220.197.31.2
X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.2])
	(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 6E8A760A380C;
	Thu, 22 Oct 2026 14:48:59 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6E8A760A380C
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=GK
	i/ofm15B962rnTZ6pz7sBCLjR4QVY0SWHqOf6JCUk=; b=KD+/7fdbp5aIBfYShw
	3yxXZMl0L0gIkBI3m+Qw/OnZSmQCt5DDi10KHEJlrie23YQLad0URPnJCWIEKRRU
	iK5qx5FVqpdwagL3TcuhRjXlPecUE22Vc65bQyzu8o6pEx47YCXDS2W9RpMQ5MaO
	Z3xaPFvs27feIoNKjG+Z3LsK4=
X-Received: from shaos.localdomain (unknown [])
	by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wDn77w7ItpqP6HzBw--.6871S2;
	Thu, 22 Oct 2026 22:48:28 +0800 (CST)
X-Cc: Jiri Pirko <jiri@resnulli.us>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	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: _____wDn77w7ItpqP6HzBw--.6871S2
X-Coremail-Antispam: 1Uf129KBjvJXoW7ZrykCw1rCw48KFykXF17GFg_yoW8Cr1fpr
	Z29as0ka4UtF15tan2kFW8X3WagFZakF47Ca4UX34DZa13uw1jkrWfK34Y9FW7ZrykCFWF
	vw4Ygas2gF4rKaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jo7KsUUUUU=
X-CM-SenderInfo: pvkd40jtr6il2tof0z/xtbCzxzo9mraIjzNPQAA3T