Article View: linux.kernel.netdev
Article #12905[PATCH 2/3] ipv6: return EMSGSIZE when first route in dump does not fit
From: Stephen Hemminger
Date: Mon, 09 Nov 2026 01:13
Date: Mon, 09 Nov 2026 01:13
39 lines
12530 bytes
12530 bytes
If a route does not fit in an empty dump skb, fib6_dump_node()
suspends the walker and inet6_dump_fib() returns 1. rtnl_dumpit()
then returns skb->len, which is 0, and the dump ends with NLMSG_DONE
and status 0, silently dropping the route and those after it.
This became reachable when multipath routes started being dumped as a
single message with an RTA_MULTIPATH attribute; a wide enough route no
longer fits.
Return -EMSGSIZE in this case, as IPv4 does. This depends on the
rtnl_dumpit() fix in the previous patch.
Fixes: beb1afac518d ("net: ipv6: Add support to dump multipath routes via RTA_MULTIPATH attribute")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/ipv6/ip6_fib.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index e1d49897d6ab..1025267992f0 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -755,6 +755,12 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
unlock:
rcu_read_unlock();
+ /* The walker stopped before adding anything, so the next route
+ * is too large for this skb. Report that instead of letting an
+ * empty skb look like the end of the dump.
+ */
+ if (err > 0 && !skb->len)
+ err = -EMSGSIZE;
if (err <= 0)
fib6_dump_end(cb);
return err;
--
2.53.0
Technical Details
Message-ID:
<20261109012115.11898-3-stephen@networkplumber.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358935-linux-kernel-netdev=dewy.ruReferences:
<20261109012115.11898-1-stephen@networkplumber.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-358935-linux-kernel-netdev=dewy.ru
From: stephen@networkplumber.org (Stephen Hemminger)
Newsgroups: linux.kernel.netdev
Subject: [PATCH 2/3] ipv6: return EMSGSIZE when first route in dump does not fit
Date: Sun, 8 Nov 2026 17:13:13 -0800
Organization: Usenet Network
Message-ID: <20261109012115.11898-3-stephen@networkplumber.org>
References: <20261109012115.11898-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="243765"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:GcrZbIazODaNILxZebOJp9Mwbf8= sha256:jXpXNIcfuJntdV9Dixfknyjy2DJRLPZpVM+7ShemE20=
sha1:SsGf4eAahSsZipm8VjT1EYGaoRg= sha256:kef2VsSyVLyvq6oqJ7BM+YE5EjOwVFq+KVubVYo400A=
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 C5A8F113679; Mon, 9 Nov 2026 04:22:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-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 (2048-bit key)
header.d=networkplumber-org.20260707.gappssmtp.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 40KQKpfkVJ0P;
Mon, 9 Nov 2026 04:22:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-358935-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=quarantine dis=none) header.from=networkplumber.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id 4F425113676; Mon, 9 Nov 2026 04:22:10 +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 4D3F434331; Mon, 9 Nov 2026 01:21:29 +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=1794187283;
b=wNVje+xNoK/nr5Ptwke/IIvbPZunp7GcZrMUYiPprqH+979cdOJK7UfeG1hVhfeys3Pc
84WFp7bcn8A67mmw4ILluizGldHKgvqFTIoaI/fURyJMfeFs5v87xS5aYuKJgoGmuhZ3Q
zvv0bnDsh9gb5AjeJebtOUaASAfL1L71Qs2iIZvSFjdP5ecrToFHuME4UwHdqSgpclQzm
wRsXIwM77NqqEECreq3bpe1eHbaLs5JBMzY1+OuQ0zz0ZoVqY4dIb6X4UsQ7cdAD8xXOM
FLKA31zHfTI/jsAgP21YS/0BosqT9H96VCkZBrYcOFb2aP5Zi5sBgbimNUPAg4WTaWQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794187283;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID: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=JbaGCvN2cTvM37NE17BDipBUuFaHtKV8fH8i8HWWLkY=;
b=5AhsJlLhVGu/blc9aMh/xOa7hVhFhzGTvnpXLj5pPWXGlMg/oa5vo7QLHQExSLGjSbz2
pO1sgOXkPuq8gn9VvTvNZNkdaUpmeqFt0uD7ITvlUz3J0D8fEz8UHPDZEEnPkLxK7iNdi
xw8wguCmBw0sagc+GRCdizOt85DsWb+C9LUNG039IrEn3E0v2dInzhTEaoUO1b7WrIS6E
MVeBCJyV/r91z1jUJqDR+3RknwQyCWlIKjiYioib8iNkReY02l4Wu1MxipGnxHI9WaXQI
FEsT1tZ+TJsD5xjEuy9RZNXJpU7x2ZRLsq6hfwgdFMMCC/QdqDTF6tUQoqDrD0nF02Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=ZhUe0uCS;
dmarc=pass header.from=networkplumber.org;
spf=pass smtp.mailfrom=networkplumber.org;
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 1C555606D83C;
Mon, 9 Nov 2026 01:21:23 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=ZhUe0uCS
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.43
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794187282;
b=LIG8MPbloxZ4+a6SQoXxDgcaSrmZfA7v0ZVUoOAwNcY5wVqmymTJvsnSRi2fACycl/k8
PXOlKJZi1HJK0RCVvjjVGS1C2oOYRmkVpKDIQ+KeRwCjBxwNFq0ZfRCN3psRNxXRdxOzb
FJyYOTA61/MYUa1ILLopJCwsIISuw2giJ570Fsm5mV64PRoMZ4WLI7cH39xWqJzpOtlW6
RInrSJS0ZjONXsCeFigoS9npgi6Is76xbKzdFlbyrTofY5O8HRDPaKqIBIuyuFNT5Uu2p
GblzSCZbJSkMMm2gt25ubeS3eYwMZw9qM4TmG/QlyOwf/2WfySMo9C/mfnBBSt7z7lA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794187282;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=JbaGCvN2cTvM37NE17BDipBUuFaHtKV8fH8i8HWWLkY=;
b=JxeP84hLLfUdhUq2rEg+havM9jmqBqRg30A6Q7vH4HRGy8c1eqLcthzyg8zi5nkcJzew
7r4brSi4hT6jTKFINofExLElzrvkKP9DaapZRL6b9UF3IrfqHscH5DM5h94DUQfHW56kr
z1lwtXoD2kt/V9v8wuvi8QoIDQHRBssAgXoKrJh9gjcVRe1e74aQsIsSqHiT6H8NazvsS
wekbEYu4htJMaNkrM3bAlu3YXDI2wwhx3vHiU9UhO4yZIZ9isryN67TK32A9YkhawJaHu
uQ8JM+Z6Eqoyz41GvwrtFij18r2UdZRSkKCpnixrOdiC0miZ1zoeLcmh3NVNI+Q1xRA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=networkplumber.org;
spf=pass smtp.mailfrom=networkplumber.org;
dkim=pass header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=ZhUe0uCS;
arc=none smtp.remote-ip=209.85.216.43
X-Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43])
(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 E65DF606D832
for <netdev@vger.kernel.org>; Mon, 9 Nov 2026 01:21:21 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E65DF606D832
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org
X-Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-3b094e649d3so228650a91.0
for <netdev@vger.kernel.org>; Sun, 08 Nov 2026 17:21:21 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1794187281; x=1794792081; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=JbaGCvN2cTvM37NE17BDipBUuFaHtKV8fH8i8HWWLkY=;
b=ZhUe0uCSDNhuZ+9kVOhTRmUbH68NzwI72Us2qWegQ8cxGqa/QFhKcnVYWamSHE1bCG
evu1nvplRDDAd0s+udWtXyPl1cp4klrvrOagVDIO+tWRb0Gty0xU2peaoG5mTjT8U4M6
hbN+v2u6JrnoDyCCH5HEoOM7tKzLBc9pG3NyFkkhjmjd9Lis/TyD5Plx6SOyfdTicQ4O
Uvz/q57pmSsUzh7FXmRF5tq3f/QFnfqXf+SF1SWBYHg43fr4g2XMna/UKEBGEMC1xwIO
MaHlzRKZNvfIjtdenizWqwzr5WWycRvsjP1HG2F/F7Pfg2Zd4hdCd5HYlz9brCiLeuDv
AY5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794187281; x=1794792081;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to:content-type;
bh=JbaGCvN2cTvM37NE17BDipBUuFaHtKV8fH8i8HWWLkY=;
b=tyHeg0ZPS0KNFBK8X6fiJN+EZDpSfYWoJaQ3AoBmX5XH1ZaH+hCoklw9mohLsjFGvG
yn6WR/hBrlBns2MS78avPBqj94972fJmp1gaPpkVTAxBnz3bcUHJcHdWHePfYVCckQB8
VMX57EhWP9nDaCa+dqThclbYvFrvgEyJLt6NcSS7ON+Mo77vXV4K1imd2X/lB491Goxu
sIC50pM/i3bzOUSJdF1wPHwZ+iZkY0gvWs5fdpvyrt/Zz9pKoV9cdiYTzk2kvCHRKujC
NwunWIglWNZYZf6LWAwKK/BLW66cNKU8rL+s+UiLVyxGRV1A3bB/J5L8TCDj/uJ5IzJl
yR3w==
X-Gm-Message-State: APuU4Z+0UcOGtfqte9yO4s+gN2XV0bSXiyUdze7Gb0h9aAlpXXHzLh0I
H/24+TQJy/Srsw5ldXMsUIvkljKpvpuOYx/aUcEW0Qn38dHbAVdxwRd9jVOptFgIK8E5uC5eYQS
Oaige
X-Gm-Gg: AYBFou0GO1hlWkZYQ1nJRRwOPyv1IfhF20sOd8jdhkvU8cZuWXf0HJc66Kd/Z63c2jv
1wbSx6oeaC8qmp+7QduCQ+W/DYHgTBXSKkeCCTfeSC+vCV4YaFmgRnwHD8UtHjxFPtl2+G/9dpd
XBJwd25cdmIO2zBGFuAvbB5Lp0/A+eYJXYSbtAQTt+hauq+ZeBfFuWJh9p2eMaXQOPFMMZ575vy
aWHVqfthSU7rl0nighMMW6aNzUrbeeR48JScRgl5AUeOdOSBg5YlYoZWOC+MXNhRyWYvAxOUmMi
NPCP/96EomSFdbMmNQHqKVcfC6gNeYplcUE+t15q8crH4/MNszzyqKxaDug/CMbgw24haV0h16x
u6y5sMLfA8b3fj3L0qsvjDmvXZUlZ+hIkGKdfPYa0ITk3lqK6RDz8Mn86duxS4b+myUgZqwXUWW
MGnzzTkwDCxlQDtcOQJdCDkXJwcGY3hcpuNdpq+nCpysA8bih3ikp2vp6dqi891P5fQh9vIhr8n
M5BHEeRviS549y8Oae175l5dDTmU9wLepNm8u/Xm1vVLFwTiwxguKYwWiUqxvcPpC9cg9qpIIpM
57OVue+9/ZU3xdsZTk9OLrt0QnxWh180Teile2I7BZ7HcOGDFjq/nkmussK9SkwhTdEwMRZ/3Ne
hzQnImmz03GA0AOKF
X-Received: by 2002:a17:90b:2648:b0:3ad:b7d1:8631 with SMTP id 98e67ed59e1d1-3b12d3e7092mr2210079a91.17.1794187281287;
Sun, 08 Nov 2026 17:21:21 -0800 (PST)
X-Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43])
by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b103432e26sm4883217a91.3.2026.11.08.17.21.20
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 08 Nov 2026 17:21:20 -0800 (PST)
X-Cc: dsahern@kernel.org,
Stephen Hemminger <stephen@networkplumber.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>,
linux-kernel@vger.kernel.org (open list)
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <20261109012115.11898-1-stephen@networkplumber.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