Article View: linux.kernel.netdev
Article #6473[BUG] net/sched: CBS slope conversion wraps on 32-bit kernels
From: shaos
Date: Thu, 22 Oct 2026 14:47
Date: Thu, 22 Oct 2026 14:47
31 lines
10435 bytes
10435 bytes
Hello, On an ILP32 kernel, a successful CBS qdisc request converts a signed 32-bit slope to unsigned long and multiplies by 125 before widening to s64. This wraps values above UINT32_MAX/125 and turns a negative send slope into a positive dumped value. HEAD commit: c03c1a14507dfaf8b856c2608f9ac216021fc222 git tree: 30fd2ef82912c26cf3a58ad0ba6afc375fa851ac source version: Linux 7.3.0, local master compiler: Clang/LLVM 20 and LLD, i386 build console output: https://gist.githubusercontent.com/shaos26/dbaa4a3726bde3bc54298b094d1c13ff/raw/d2c0239d34db2dd28138fe0f267a96263d06c8c1/console-output.txt kernel config: https://gist.githubusercontent.com/shaos26/dbaa4a3726bde3bc54298b094d1c13ff/raw/bb3de79c6447b2180acb836fd229584486405419/kernel-config.txt reproducer: https://gist.githubusercontent.com/shaos26/dbaa4a3726bde3bc54298b094d1c13ff/raw/9b82c23a085560adab3f89894fe0847d324be1f6/poc.c 32-bit compatibility header: https://gist.githubusercontent.com/shaos26/dbaa4a3726bde3bc54298b094d1c13ff/raw/16b578cf6d1de2e13f157406d9b1a55bf15725b1/shim32-sys-socket.h reproduction instructions: https://gist.githubusercontent.com/shaos26/dbaa4a3726bde3bc54298b094d1c13ff/raw/28cf51867cfa9e7586e7bb6f2062bb3db9bd31c6/reproduction.md Build the tested kernel for i386 from the exact commit using the attached configuration, install kernel headers, compile poc.c as a freestanding static i386 binary, and boot it in qemu-system-i386. Use the attached reproduction.md for the exact i386 build and boot commands. The i386 compatibility header is supplied separately; the PoC intentionally rejects 64-bit builds. Impact and prerequisites: CBS installs and reports incorrect shaping parameters on 32-bit kernels; the same requests round-trip on x86-64. CAP_NET_ADMIN is required. No memory safety, crash, information leak or privilege escalation is demonstrated. Validation: Two fresh i386 QEMU boots reproduced the modulo-2^32 values for boundary, negative and large slopes; x86-64 controls round-tripped the same large values. Thanks, shaos
Technical Details
Message-ID:
<20261022144742.63456-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-350621-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-350621-linux-kernel-netdev=dewy.ru From: shawnq1@163.com (shaos) Newsgroups: linux.kernel.netdev Subject: [BUG] net/sched: CBS slope conversion wraps on 32-bit kernels Date: Thu, 22 Oct 2026 14:47:42 +0000 Organization: Usenet Network Message-ID: <20261022144742.63456-1-shawnq1@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="236550"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:qu3v8fJ8rpqoJk7pECtgDg4toJ8= sha256:GkhpO58X7rMXd/wbC25VbJCwDq9Fi51xu6bmn8aUwBc= sha1:xBqNVkMcUybhN04qZ0W6gBmnLr8= sha256:z3jRi78DOzpVmtffxs0sT8tIlJ+jkHYWHxZh/WU0SO4= 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 898861112B5; Thu, 22 Oct 2026 17:56:12 +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 BEJGr30Ir-KY; Thu, 22 Oct 2026 17:56:09 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-350621-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 E11EE1112A8; Thu, 22 Oct 2026 17:55:59 +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 831242E0E7; Thu, 22 Oct 2026 14:48:40 +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=1792680509; b=iXEuuyKYSaHdAhVQI7q+GoZsACLqI94CAdntKXPLkRskuiMhpL2wZ5Icsm+OFGWyAAD5 Izk6XHiEAY7kyLjb6nybXCNWsd304M/VkBxkT1QJCRCPSTidEkQC+CRFh8J/XE/S7bF/W boFP75ycWoT9fapzqK5qjV/hXBWxpmAcxNJdNrInXbp/fuWkB4AIEunzCKjM6R5yXX22e S9xcN78tO1j/USjZqcyelKfcKBPxuYFQWs9sRDCdZNakRNfvqU8r0oI0QUScFG+BkPFTl fPrZDAJHUKiGPVdNEtfsU3TJwllfJwbQgveN/xFUzDfmsPvTeebN/WjXVaJEhChJ7tA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792680509; 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=duV/2z31rQIoU2/rD8fKnwPJbWnx1E8AZ5VoupEQHyY=; b=TScXek1R32pqBYL4chUMpr0NUxHa4afIJH3sqCuuPXnrSBRylTVO/Do8SSk4e81zCXpY P8xtqYMjqlqZKy+I8hRswI0Ib6R9Q9DMx2JkAIININonSIffU7Dsc2VgvtPYMu38heZA2 zbzDkBTH/EUeKOtWxu4fsyJlLXJxQl3L9/X2mOk9qJ1hxStvVuHM9R2BudeO8CwDMmCTJ EkvPs+119IbA53T3lc1vbiu59iM66iqOa7lhN5RukIsqmbRsF/FYU900/xfWIj13PJWEy 6h3B/gcGOvv8fI2D5gJTHINGfqypcjcPkwBnvwU5dKn0qYWk8ptELLKvHrmBPXS3ENA== 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=DDmmWq9p; 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 EF91D606A325; Thu, 22 Oct 2026 14:48:28 +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=DDmmWq9p X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=117.135.210.2 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792680508; b=CEMUa2A4lhtUvolBIXsXmHXNX8x/N11ckxMc44RtOPhIC9d1/ltGS/qgZukaKBq5LyEM lRiD/97FtNUAnunIXVBiUFneUq7hOIbpgFSaWB02kRncNN7FB34vnMdKmJJZVVdrnAXCv yA+7mGuCHKuOAACqPmmI9xNgP5hHj7ZLMCKhtrJYRxjiEhjHl6pXcYynd9mXQbL8B7oQX 4DeMbJtyOiC6vnqzRC69j/jXdQbVYhkyvTgvY00Wx6vw4fME6Z8GiXPQTDNkWxdP5tvNk 8QEyJilEcm9dDeM7hphCqRdUPA8y9TDrf2fyR+jYxe/GVuOi9BrpcYI4KtYj7IXipww== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792680508; 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=duV/2z31rQIoU2/rD8fKnwPJbWnx1E8AZ5VoupEQHyY=; b=jMwixDA1p4VL37GJG+PwleZ4slJZpXB2VYoI5Pt7JhtO4GOWF1Ei+e5u8czz2ZS+kD6A zBDEVAPc806whII1Bj2OzE4sGdlfWKp//L2AaSFEu7kWuT9r3K9KyKbyrd1Hk8+hEndZ9 eg+df1oGJFaBWsoMnWYgQtQ6807rGpaRjnMdrIRtIaBNbmZKEoUMOgj8MtpNZtz4M/P/y LW21ePzHZ6im49L8dNwtuC7YsEJXanibI3bUs7MTHCIkVYfZxVdth0Wx/J/sjeOgS9/Cz 37Zm0RGnqC//YHQq/VJ7hI7IfAyecbgFy61g+HeDdYM/OHYZiRAdKl91H3VxMSRIUHg== 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=DDmmWq9p; arc=none smtp.remote-ip=117.135.210.2 X-Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.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 DD926606A335; Thu, 22 Oct 2026 14:48:26 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DD926606A335 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=du V/2z31rQIoU2/rD8fKnwPJbWnx1E8AZ5VoupEQHyY=; b=DDmmWq9p873WGfWws4 xbkucp9OyugfWW5qjMvb5Qz3oSnuH8LNQ+NKYA/4opTpEY3RAyeQBv0EBI7aArX2 WNzxxzNmpT06q89GXeo4eyBDdm0gzpCnQysaI5WEodjDgQGZBgNE5/iwSJAuAnI4 3QdmsGm5yiKbh0b3ixXzmdWmQ= X-Received: from shaos.localdomain (unknown []) by gzga-smtp-mtada-g1-3 (Coremail) with SMTP id _____wD3h04OItpq8HXqBg--.26724S2; Thu, 22 Oct 2026 22:47:43 +0800 (CST) X-Cc: Jamal Hadi Salim <jhs@mojatatu.com>, 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: _____wD3h04OItpq8HXqBg--.26724S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7WFWrur18tw17GF4rJry8AFb_yoW8tF18pa yvy345t3Z8Xr1UJr92yFWkZa18K393Aa1UG3s5Gw1IvrZIk3Wvyw4Iyr15AFy3X34kGrWr ZrnY9F1kW395uFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j5eOLUUUUU= X-CM-SenderInfo: pvkd40jtr6il2tof0z/xtbCzw-c6mraIg-KQAAA3h