🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18241

Re: [PATCH net-next v3 1/3] rtnetlink: return EMSGSIZE when first dump entry does not fit

#18241
From: Hangbin Liu
Date: Wed, 18 Nov 2026 02:01
39 lines
10081 bytes
Hi Stephen,
On Tue, Nov 17, 2026 at 02:13:42PM -0800, Stephen Hemminger wrote:
> If a route entry is too large for the dump skb, the dump is silently
> truncated and no error is returned.
> 
> For handlers with RTNL_FLAG_DUMP_SPLIT_NLM_DONE, rtnl_dumpit() drops
> -EMSGSIZE and returns skb->len. With an empty skb this is 0, so the
> dump ends with NLMSG_DONE and status 0, and the remaining entries are
> lost.
> 
> The first dump skb is allocated from __netlink_dump_start() while
> max_recvmsg_len is still 0, so it is only NLMSG_GOODSIZE. On a 4K page
> kernel that is under 4000 bytes, and a 500 way multipath route does not
> fit:
> 
>   ip link add dummy0 type dummy
>   ip link set dummy0 up
>   ip route add 198.51.100.0/24 table 100 \
>         $(for i in $(seq 500); do echo -n "nexthop dev dummy0 "; done)
>   ip route show table 100
> 
> The dump prints nothing and exits 0
> 
> Only ignore -EMSGSIZE when the skb has data, so that an entry which
> does not fit in an empty skb reports the error to user space.
> 
> This only covers handlers which report a too large entry with
> -EMSGSIZE, such as the IPv4 FIB dump. inet6_dump_fib() instead returns
> a positive value when the first route does not fit, so the check added
> here never fires for it; that case is fixed by the next patch in this
> series.
> 
> Fixes: 5b4b62a169e1 ("rtnetlink: make the "split" NLM_DONE handling generic")

Should we keep the Fixes tag or not for net-next?

Thanks
Hangbin
Technical Details
Message-ID: <av0HEABXXzKVNnoU@fedora>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365794-linux-kernel-netdev=dewy.ru
References: <20261117221538.184948-1-stephen@networkplumber.org> <20261117221538.184948-2-stephen@networkplumber.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365794-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 1/3] rtnetlink: return EMSGSIZE when first
 dump entry does not fit
Date: Wed, 18 Nov 2026 10:01:52 +0800
Organization: Usenet Network
Message-ID: <av0HEABXXzKVNnoU@fedora>
References: <20261117221538.184948-1-stephen@networkplumber.org>
 <20261117221538.184948-2-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="2479286"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:gQXQqUFndYp9shkQrqy2I6yLz5M= sha256:LkZ45/PdFysfaWWPaVjGrUmUITQmlks3CYREWwRDcwo=
	sha1:2X4huUbz2XATVIprCNrKlItWAak= sha256:bIMYpq0uGzgqdLKWFdQ5DjGT0L/JrbKh4/nQfh9gUEQ=
Content-Disposition: inline
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 DAC9B115146; Wed, 18 Nov 2026 05:02:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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=linux.dev
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 iVf1EDHzD5x8;
	Wed, 18 Nov 2026 05:02:22 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365794-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id A6D1311513F; Wed, 18 Nov 2026 05:02:13 +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 402763F206; Wed, 18 Nov 2026 02:02:12 +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=1794967332;
	b=uyIfeeKsekeVHH8vTV+sREM7OL1r2Jy+CntkL14/z3SSvvLVk8Mwiu4i+SFAHQ5GydKL
	 jz/gvzhu27GVvbz2bmQoRRyOnC/MdJ59Dyj42NEKBiLaDXf95o/8XDJUoYhDE/T4tmuyN
	 1DPYwrnQtYHuGrPs3mzj1nTWGiFX7xavQdNiRyOrIIxEzSZfyBucTkPXWr8xLXCxWbPoP
	 HJErcHCPLA9aFmjZe9Dr/r0VXGWmOOwjSjaEkJADm30q7bF0Tg2cbVoZOlv7Bi/+fTseC
	 9NXuRBeVZCSMdYZc0YWaH8HlnHY29rZEV4m3bdKcs3yWo5Aj1+pBEVBxoKgfqM//zwQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794967332;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=fQj5g/lvk0EAaX6Co41L4LJ2o/AwPZge1e0aV/8cDx0=;
	b=LmbzAUuIGliWTYOT2ypZhOBTsGT3oxsRtkNIBwjG/vj/lVl290MilFrxAuGJoYNGuLab
	 nUH2zarxXk5tRctvK7lfk4uPZoYaiFmaBad3Rnv9H4MG+HIcL1javT6oWr9a3Gs4PVuzE
	 jueM4eTxhn4t9BIJojDloVcn04ju02VGvBX03wN+eej1EUcOsvUyxUKFdSUNVH+0k6dlI
	 SJVr2+vg6VUo+wpyiMB1yJfHPGcJYEKsTDvvJ2G6dcIAkmPCSrBNGCXW4R/H/QcYnwZQA
	 Z7MT5rTbJ03sKSu0rpIZV4TWCwSfWEq2zFPvEN1IJGg9P/b1i50acqyskWfTn5fj/jQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ohTpTWfv;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 ECBDA606A333;
	Wed, 18 Nov 2026 02:02:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ohTpTWfv
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.165
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794967326;
	b=XyTZ/eYmNNPpQSbf26P9AZQXf7kUxJXTBnR1u1wXZh3nvHzq3IwT8btE68nmY1XJlyft
	 GTrsU44qUOhwlNi/y4xPdVL/8mw73qYoPdz3omx1L+xo0In9Dj6jS1PVatCArwsujLVEF
	 8WqHQ4J+XVoyRfod710LyIUQU4L432VsMOfrKP4FuhrQaCdfCuDf1lPEI5PDUIvOauO2U
	 jHxwxXFv+Mq9SEX2JmsqEwlCTnS0aSQfVHje4y9MV/zD+7dHDtVe5T8ZE63T06mb6mhOi
	 Cgmh7QvJcCVPcuVUQ3aNrMrESgTiZci8gqnedCaQ7P5cu9DN2dRnXP5mEiYnRXmax/A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794967326;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=fQj5g/lvk0EAaX6Co41L4LJ2o/AwPZge1e0aV/8cDx0=;
	b=MERdVVQNy7Amk1qroZxIPiGeWNa2DcAUob09Q2t4mbY3H8vHrd06kGHqu2FqU1Lg3IV0
	 xnRZ1n/d3le8py3NE1mg88ABSAqWNkd+8VkzMUrjbVNA+u9aD3NNSpodFy3WQrVzpcQOG
	 wPAtruV8owjs07U4drwdxoJJYdmhyr15L0oMGhwPhVbULw2bt0bgRlABZp1Ft2FQsm3+g
	 BXtB05epDkGu4MpmXA2jPtnl7MQN63BMnDgtvN4LJqzL7Lq0qU8kJ/AGChIx5N9abGQHl
	 ZcMPm9tV5ORLFrvdWQ4CdrUVX+PNXrLB/37z1uzAhXvEtzbNQC+4bnX8kxakAdz+Ceg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ohTpTWfv;
	arc=none smtp.remote-ip=95.215.58.165
X-Received: from mta1.migadu.com (out-165.mta1.migadu.com [95.215.58.165])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 787A8606A31C
	for <netdev@vger.kernel.org>; Wed, 18 Nov 2026 02:02:05 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 787A8606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=UB1RHYa2kLvTkXPuxKeUXS1UT2WJukR57HA+prhjOZE=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1794967323; v=1; x=1795572123;
 b=ohTpTWfvKgMMQAMA9nEGh409M/JMovk8/hBIXVa5S1JEijFjZl9mMCWWL0BO7XWdMXM0x9az
 0r8QdtDa0ycudLZ6NuiQrS4llen50fKCp9DqGvYR21IEZSCk+YK80eBaY/c2yv+VP87K9U68n7E
 DAasMJPmt7Up5LoxznoS1e8A=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta12.migadu.com with ESMTPS id 897deb0b419e9f34;
	Wed, 18 Nov 2026 02:02:02 +0000
X-Mizu-Trace-ID: 897deb0b419e9f34
X-Migadu-Flow: FLOW_OUT
X-Cc: netdev@vger.kernel.org, dsahern@kernel.org,
	Ido Schimmel <idosch@nvidia.com>,
	"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>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Sabrina Dubroca <sd@queasysnail.net>,
	Andrea Parri <parri.andrea@gmail.com>,
	Stanislav Fomichev <sdf.kernel@gmail.com>,
	Nikolaos Gkarlis <nickgarlis@gmail.com>,
	Willem de Bruijn <willemb@google.com>,
	open list <linux-kernel@vger.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
X-In-Reply-To: <20261117221538.184948-2-stephen@networkplumber.org>