🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6607

Re: [PATCH net 1/2] net: dsa: mxl862xx: bound FDB dump walk by table capacity

#6607
From: memoriaru
Date: Thu, 22 Oct 2026 20:14
40 lines
11002 bytes
From: Zhang Hewei <memoriaru@foxmail.com>

Hi,

Replying with the missing context requested by the bot:

Discovery: both issues were found by manual code inspection, while
auditing this driver's handling of device-controlled responses (the
MAC table walk and the BRIDGE_ALLOC reply).

Trigger status:

Patch 1 (unbounded FDB dump walk): the loop mechanism was reproduced
in-kernel. A self-contained module carrying the verbatim loop shape of
mxl862xx_port_fdb_dump() (device transport stubbed) was built against
the official Ubuntu 6.8.0-71 kernel headers and loaded under QEMU (TCG,
unmodified official vmlinuz): the walk never terminated on its own
(100M iterations logged; a real table holds 4-16k entries). The
reproduction is fully automated in Docker and needs no special
hardware. I do not have access to mxl862xx hardware, so this
exercises the driver-side loop logic, not the real device.

Patch 2 (bridge_id == 0 accepted): reproduced at the logic level in
the same module: the driver consumes the firmware-supplied bridge_id
with only a ret < 0 check, so id 0 -- which the API header declares
unused (mxl862xx-api.h:243-244) and which equals
MXL862XX_DEFAULT_BRIDGE (the CPU port) -- is accepted verbatim as the
port FID, merging the port's filtering domain with the CPU port's.
Whether a device can be made to actually return 0 is unknown without
hardware; per the API spec such a reply is already protocol-invalid.

Build status: the reproduction module compiles and runs on the
official kernel; the two patch hunks themselves are small and
mechanical and have not been compile-tested against a full kernel
tree (no mxl862xx hardware available here). Reproduction code can be
shared on request.

Thanks,
Zhang Hewei
Technical Details
Message-ID: <tencent_1450C834A812C63AE916E5F22AC31A453C06@qq.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-350803-linux-kernel-netdev=dewy.ru
References: <20261022200425.80147-1-memoriaru@foxmail.com> <179269966728.3290.2627206928544645649@kernel.org>

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-350803-linux-kernel-netdev=dewy.ru
From: memoriaru@foxmail.com
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/2] net: dsa: mxl862xx: bound FDB dump walk by table capacity
Date: Fri, 23 Oct 2026 04:14:20 +0800
Organization: Usenet Network
Message-ID: <tencent_1450C834A812C63AE916E5F22AC31A453C06@qq.com>
References: <20261022200425.80147-1-memoriaru@foxmail.com> <179269966728.3290.2627206928544645649@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="315615"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:zDq5ZH9ZEKupcW0e4AO9wReGA8s= sha256:WyhK0Lu5q5QqqHw+sxCVcgWMv5n9SdZsM3bc4cH3AJk=
	sha1:JaoW64VP2wnSxf4eFlfZQF6AS5c= sha256:10PJsvImCHz/58LIU1sc5Sp4CZrs8Np2gTaO4mE9OLY=
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 CC99D11136B; Thu, 22 Oct 2026 23:15:52 +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.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=foxmail.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 foW7qobcpz8L;
	Thu, 22 Oct 2026 23:15:49 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350803-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=foxmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 25BA911110F; Thu, 22 Oct 2026 23:15:41 +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 3873D2B372; Thu, 22 Oct 2026 20:14:33 +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=1792700073;
	b=StDw5vbq7n4k9uTzs1R34At0KaCUy1dI5BplWfBV9sUarXJyTmKFQNHSSz3Ubysv6gaQ
	 DqPjvJ39ADOM+TlSq4Lj+ebAaBEwUgeKM9xRf5ZqiVaoU17P4Xoqx+9tEXGlBzk4wtZl1
	 DI3AB2I+bD/LJQ8+CjAiKJh2bufBEvoSckfyaegd0zz5I5DLQtHBEHV0zL2uDlFbWpw3z
	 G1LRWnE6g0wTwmks4v7mHTc5EDwsmm9PskE3LebnMd323uoWFZZ1oOhSf0TNCGzC0ydNu
	 u5MU4eH0ddWd3Bs95+C9I1SXcKq4DS68AS41q2jzhKyPny5DJ2v51tMolFkAXml637A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792700073;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:X-QQ-mid:
	 Message-ID:X-QQ-XMAILINFO:X-QQ-XMRINFO:From:To:Subject:Date:
	 X-OQ-MSGID:X-Mailer:In-Reply-To:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=LAPtyJfEMoCnzw9imSIjb9889rqZ7TMiB3U5SmWB/LY=;
	b=rrTvEZxqrrmh5/zAWMJIAMx63RSdJ401xMkEphXveKUtw7qmXNfBj0rbXV58K176w4MV
	 rEWydNSa7C6QjYIj7ZhNJJ8QrBQrdm98cyVzzTA5I4no9V0HKKA7PVC+NDvlMugjvyajb
	 v6rbOOuTrTvpZqqwe2WZhWbOi6ATuQcvLVmMaB29f1pwi8NeSl3J1HEMsHwIIvedBbw+B
	 YvURQDQGW6kqpN4+7tekr7jd4+FusHmGk0glKWKOuIfWvSv0Y2qFA/YuDE3uBIcijA6wU
	 WEan9/B405+p+bJt6l/VkMWmbpS+jydXmlw0sdHaJS53ANy9ZBXkd9amrej9eGPuhpg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b=Ip6eSAcI;
	dmarc=pass header.from=foxmail.com;
	spf=pass smtp.mailfrom=foxmail.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 0F412606A321;
	Thu, 22 Oct 2026 20:14:33 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b=Ip6eSAcI
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=203.205.221.202
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792700072;
	b=M/lGUP0LEH1cVqvKVo7wspGoZliqvH/UVxycUWTcfuE9MumOc1Q1ubkcEcd+NqLLNBSm
	 FqM4t/3AkZ10MzrJ/WFkemZOMsQln+++rJFwSnm+2mvIWfJixJVzcTEaez2GykGBEx6Yi
	 pg+9WngXN22oOYjI3a/xP6LBXDdnP/RwsR4s5Zgui+6U81Yc1eCjtQAKgpVPRwxHA6x6n
	 Ni1HEiAFtM33MGO018vlbZqhgI0qZxQlDXV0jnbfmoGCLzmzvD+ChEzuPJRWD8otdiAb5
	 IskSrydwoo7igm/kgdfCHY+13oE+1wryqWPyw5XrNIj75jTLT1mXOk5kmoJT5GyEOKQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792700072;
	h=DMARC-Filter:DKIM-Signature:Received:X-QQ-mid:Message-ID:
	 X-QQ-XMAILINFO:X-QQ-XMRINFO:From:To:Subject:Date:X-OQ-MSGID:X-Mailer:
	 In-Reply-To:References:MIME-Version:Content-Transfer-Encoding;
	bh=LAPtyJfEMoCnzw9imSIjb9889rqZ7TMiB3U5SmWB/LY=;
	b=wdR+KAM6LI3Xf1HbIEPIDTbH+tMZ1J3XHPM4JdBz5Ey/ZESPsexHAbsRRu8kw3Fmv9dV
	 klFML/ZqylPLjWW3yW9W520eQPCu78yYw02qClcHHDN1jSwYQvNPihgNFhiccEeFK+hfE
	 vkuWPb6eZQJiiOWRiZeqyw0nA1z34ptWqpH7NdH2REJK5fqAN3XLF6ITHyY5G5IpbjX74
	 qCmWk2frTZGuRD7vP4jSHokXJ87xSf12+Ou8Yh7bJs/fTnRHO+BONxbyQIvL2YcAsnh3v
	 af419msQ2c0CjLWi/IIQibFt5cCBUnXklz9DySMyZhGOQpR/EfpsUs3raSHdBZUSaMw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=foxmail.com;
	spf=pass smtp.mailfrom=foxmail.com;
	dkim=pass header.d=foxmail.com header.i=@foxmail.com header.a=rsa-sha256 header.s=s201512 header.b=Ip6eSAcI;
	arc=none smtp.remote-ip=203.205.221.202
X-Received: from out203-205-221-202.mail.qq.com (out203-205-221-202.mail.qq.com [203.205.221.202])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F008606A31D
	for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 20:14:29 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3F008606A31D
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com;
	s=s201512; t=1792700062;
	bh=LAPtyJfEMoCnzw9imSIjb9889rqZ7TMiB3U5SmWB/LY=;
	h=From:To:Subject:Date:In-Reply-To:References;
	b=Ip6eSAcITahWxT8Rv2VPbIg8BW1OpIFQETjo+JeHWwQZeQ0Fwdan1NZ9+oFUPoTD4
	 snPw1A8LiiWMndpqspDZNTht7WNaupCYGIUc7AIAU8AfdA9E69pTpcg0RfkJpEBqNb
	 Umi0kfoC639CLKECSRIn1nwMgNfa1ZSCfMlq2caU=
X-Received: from localhost.localdomain ([180.165.29.111])
	by newxmesmtplogicsvrszc43-0.qq.com (NewEsmtp) with SMTP
	id 3943CEE7; Fri, 23 Oct 2026 04:14:20 +0800
X-QQ-mid: xmsmtpt1792700060tafu7is3n
X-QQ-XMAILINFO: M1rD3f8svNznNAJO8ZeIu/Sk9j9qYfm/wPfLZaqn8t+6EYPk1Ic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: M/715EihBoGS47X28/vv4NpnfpeBLnr4Qg==
X-OQ-MSGID: <20261022201420.81861-1-memoriaru@foxmail.com>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
X-In-Reply-To: <179269966728.3290.2627206928544645649@kernel.org>
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