🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6925

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

#6925
From: memoriaru
Date: Fri, 23 Oct 2026 20:32
36 lines
11106 bytes
From: Zhang Hewei <memoriaru@foxmail.com>

Thanks -- reviewed both Medium findings against the tree. Planning a
v2; replies to each below.

[Medium] off-by-one in the capacity check: the fix is warranted, with
one nuance on the premise. The kernel-doc for @last says "Indicates
that the read operation returned last entry", which reads as last
being set on the response that carries the final entry -- under that
reading, a walk of exactly MXL862XX_MAC_TABLE_FDB_SIZE entries
completes before the check trips. If instead the terminal response
carries no entry (and still counts as a read), the current order
rejects a correctly ended full table. The public headers do not
settle which it is, so v2 moves the param.last test above the count
check and drops the protocol dependency entirely; the macro name and
the error message get reworded to "conservative upper bound" to match
the comment.

[Medium] is rejecting only bridge_id 0 enough: fair. INVALID_HANDLE
is referenced by the API docs but never defined or checked by the
driver, so if it is 0xffff (the MaxLinear GSW convention), a failed
allocation would currently be consumed as a FID. v2 rejects 0xffff as
well, and range-checks the id once the driver-side bridge limit is
confirmed. Duplicate-id detection: the cross-domain fdb_del
consequence you describe is real; I'll see how far validation can go
without inventing API facts that are absent from the public headers.

The Lows are accepted too: the comment hunk moves into patch 1, the
"growing kernel memory without bound" wording is dropped (reported
entries consume the fixed netlink dump skb and -EMSGSIZE aborts the
walk; the unbounded case is a device answering forever with entries
that are filtered out before the callback), Fixes: tags will be
added, and the self Reported-by trailer goes away.

pw-bot: cr
Technical Details
Message-ID: <tencent_C230526401C94D7F29DDACF76C712DA7330A@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-351220-linux-kernel-netdev=dewy.ru
References: <20261022200425.80147-1-memoriaru@foxmail.com> <179278688436.3134.7157929929766878085@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-351220-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: Sat, 24 Oct 2026 04:32:06 +0800
Organization: Usenet Network
Message-ID: <tencent_C230526401C94D7F29DDACF76C712DA7330A@qq.com>
References: <20261022200425.80147-1-memoriaru@foxmail.com> <179278688436.3134.7157929929766878085@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="604560"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rEItpyemgTtAPd+mOchrE0UH2LM= sha256:T+nS3xaaWtEXJBNfkz1xB9jbr+ZSNouwz/brKYZIstc=
	sha1:8NPixl2/wmmu/NGcv3J/ox1wTpQ= sha256:5GLqHkjo+mq/svSxpsH/0oUL0Pzdvv/3WCeubjoW4NA=
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 A771E11157B; Fri, 23 Oct 2026 23:33:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.047
X-Spam-Status: No, score=-3.047 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, URIBL_BLOCKED=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 UKjRoDwW1pa5;
	Fri, 23 Oct 2026 23:33:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-351220-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id B9FE111152C; Fri, 23 Oct 2026 23:33:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 10CA032FB3; Fri, 23 Oct 2026 20:32:23 +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=1792787542;
	b=FkJid36uT6jnjDSj4KbvpZsQyOfXUiRmbnZXci42O/1S1ux3tygWyPWjqgX5oFz/r4GD
	 PsdXDOYY/oNb3/CBxNM0yPlKMlCrByP/GVf1BTPtBZz7v0AKr8fXn220Db/UURKUlEZC9
	 dMscA7+28qPkGTZ6HoNcfWwLlZhmHKng5OuMiPEUroPX9fRb/nb1jsMTrVbgzdk2T8wUB
	 NGKtlPIsrrNz+a0POTzwAXqOLe6SeGBC87feK5x/B0EyzZZOXTKeDYuEVRs5FbRTr24p3
	 2sRW0uHO8grQB0fw1mybS66ah+WSuDYVz8sO7D6/EqSHcY5VezKg1iC1oHnRU/yWrGw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792787542;
	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=pKqSiY/SjVjkcj4S0t3i0Y/6kWNN2NNw+22QabU2nUs=;
	b=5UmBe6B80IKHiNuyr2RHT7RGe/e4b25uU1nrgZUmwIZnUR+UjUk6TJOxBPWFrheXOu5A
	 vfDHT9MMNMelqCXZuC3He/uLlOuEjHKQPsnQaJqa4jFMsB8HrI9MczoyhNAcLQjRVaCw3
	 1JeE9LMK8rPJGRtOvEfwnUQUDlzQOpoWM4120lnnQrzlGi29lhtePz3gQ5s1yy/TkaRDz
	 T7NsZs6dwDdue4a//5UNpNYlwZTKovRdewIJ3N77xLa/hN+/vr0Ua+ZB2OfpurNVv5Xfu
	 XIKr1f2vEnMxCkSEOq42AOHdMBAb06D2mtMLF0ZIFM4RFr2bozxpMyvz5cM2NIcyMiA==
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=nANevys+;
	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 41D8E606A323;
	Fri, 23 Oct 2026 20:32:22 +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=nANevys+
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=162.62.57.87
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792787541;
	b=ekX8KTIKPuGIOl14T0BNZZfBoezcz9yHkYpCpUhuHPMRCECA9ZTSP00e4U6AGrqkRIEt
	 syfWn2aUsVr9qhSsY0XRc3kk8LXFxM1ch1U+/wyhOKaKZ5D1MrnCZ968ljAapyJKDfAZn
	 2cYBsNE8jn7OFNjIcbyEH+v0EwV6BXjQaeeFl81CUhH2b1oFbk8byD6yZWCC7D6SeApOm
	 cgbYk0nZdK5b+aTGWKYHBI4N02ftXmsilFWWe0N5UukQYtZ9XNCEDgA5lg2aOs1y44vfV
	 Oa/cXvqIcPNY4cg8Uow8fIUUZq4x05676ky/QYtAqNjkpXnntMtSonLdiySy/SJmnLQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792787541;
	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=pKqSiY/SjVjkcj4S0t3i0Y/6kWNN2NNw+22QabU2nUs=;
	b=vC2av3AX0gTo7qHxyOMSh5Yku3QL5BzToPPN1wji3rQrHxWHSg7Q2WQEj2CxA3qqFm73
	 hcmptO41GHQO5e8TKO8dlVLD4vi6GlZjtWxjG5/QwgD4h3h/9qDpsgR30RsudbCYeDzza
	 V73zmGuqdRazrBFzdYNyQs6yRXIhTSx9vLWYa8UMqal4HbqImGtDwm1WzkFWfQd54zMRh
	 xVHOW6jt9IvzqSVVrf7UC9qfDtTuqYebGSjM7mAlW1G4wxkEBhujG94mj944CJC0NbR1K
	 P37fjIFHoj1g0QGVrmzb72BhA270xC5sTJmh0DW8D+e73zbNQJhXqW2sQncIyDb7z/w==
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=nANevys+;
	arc=none smtp.remote-ip=162.62.57.87
X-Received: from out162-62-57-87.mail.qq.com (out162-62-57-87.mail.qq.com [162.62.57.87])
	(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 5BAD6606A31B
	for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 20:32:17 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5BAD6606A31B
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=1792787528;
	bh=pKqSiY/SjVjkcj4S0t3i0Y/6kWNN2NNw+22QabU2nUs=;
	h=From:To:Subject:Date:In-Reply-To:References;
	b=nANevys+YHtY2WW5VjTv3t21DL25ZsOyvyrDzzFq5r8+lZvP2hIydkDiOOUUnyzpf
	 i+blgF5R6A/hVuoFrewQg1Hq3mkZqwNDLeHJGP4MoHaWbWeKGUjEtI64jH8r8lXoMA
	 k5OeXananjJ1HMmA9Wj1X9NCj0vPW45zzdgg9lCQ=
X-Received: from localhost.localdomain ([180.165.29.111])
	by newxmesmtplogicsvrszc50-0.qq.com (NewEsmtp) with SMTP
	id 806A0C29; Sat, 24 Oct 2026 04:32:06 +0800
X-QQ-mid: xmsmtpt1792787526tfn38jjnw
X-QQ-XMAILINFO: MqswyhUqVe0CWbQua6uJqLc2+kolNMjkjAvVHAjjny0ATdVuxfdANZ9OT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RINFO: OWPUhxQsoeAVwkVaQIEGSKwwgKCxK/fD5g==
X-OQ-MSGID: <20261023203206.24586-1-memoriaru@foxmail.com>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
X-In-Reply-To: <179278688436.3134.7157929929766878085@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