From nobody Thu Oct 22 17:32:03 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j9Y9v3LjYz6xP4D for ; Thu, 22 Oct 2026 17:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4j9Y9v1gNBz3HBm for ; Thu, 22 Oct 2026 17:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792690323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XwJHVSFrm2ci4Sj8flS/ibty83sKm/u8HgxhjI6R6KY=; b=xGashW0SChCaWOu9vZ5rDQLVBJdu1uIyuVVuZoA5FvPHQ1vCKG/QmPHDxXrFMtj++Zel8+ BT1F3wXoU7vQw57GCzrZAPDVZsArRR+RZ3LPkEDP+Gd7623nu6USMDPjm2RiOkoExJp/Gh Dl11RaSaKPpF2iK9Uua34ZW+kKcJAtqwkBnjyzcSFzqLMAtgwgkeoUglz7noTpyi43pqVW 9X3IHYrz7jLjUakUgX4PQtlONLtP7VGyZxTuK4SRLjQxTu1I/kk1+y+TcBq/EXOjJPd8di 9n5aHjx5ZDqVv3zxGg6GRBJaZIJeFHVTzu4LP6aq6dJ2zRoICcQALLCdPs4G7A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792690323; b=a1VyRIVdnvWHR/NEtKSGgY67olzsWAfYfOmo4CKVpSTbZ+HXX896CgOhHYTQvnbLLw0Oyf gLuPDG96qnWZwxlgAT9xBerc4ruLbMpwBVz1xjuUX19x09ddPZZHfI3N5MNL8t5vziew4m Gi28rnzSpHEXbhBJVo3LySt5foB7vmf8slPPCXYRDXY/dVdJjzb9QeDyiClQPk1kJuacGj 1kBtrgvjS/gHmOAHLKZu0q05HmpMDvPj+AUzMpLr5ReGMgcamBp/saA9xYR0xCilmJAL/Y y2i/kkX18lW786twtyJAUE1uLwKEyohEm1ISkvS1Zt75BSbF5/kMtxgf5y6M2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792690323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XwJHVSFrm2ci4Sj8flS/ibty83sKm/u8HgxhjI6R6KY=; b=H8ceBBB5t+fBWm2lakuq6QGH9f2CTyP3XS6QFDfOihnKlt4DzM1f4kTvhRqGG4fYFjz+7m 4oLkyYPvz5Ws66Y0HjloXSpFHUg0t+/lbV2z0iYF5g27dP7sI0e1KuTS2GlCL3dV7jBqsW 7v2M/PNgq9/io1NEIWuRYTt2gqevtnDjF/FEHJ5MBCe5GMsGqmsCjvZi+qmMTwNjSgKjT5 Af2fN4GrV7Q7uKVTzZEGnLqZaQNgoT7FWPAE8us9NobDMx1MXCPb4Iiie/f4u6R6TFDR2X pIBIcEeJVDg/6WpL5s6zLneARBfshXjKeAAZ1sAFtBxZUu3RGNanoCJpPxfaUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j9Y9v1JcBzsSN for ; Thu, 22 Oct 2026 17:32:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c53c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 22 Oct 2026 17:32:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 20dbc462b200 - stable/15 - icmp: Limit routing table updates to the FIB of the redirect List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 20dbc462b200c2d1582c37527a5e42ae43dd8e2a Auto-Submitted: auto-generated Date: Thu, 22 Oct 2026 17:32:03 +0000 Message-Id: <6ada4893.3c53c.440e02d@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20dbc462b200c2d1582c37527a5e42ae43dd8e2a commit 20dbc462b200c2d1582c37527a5e42ae43dd8e2a Author: Mark Johnston AuthorDate: 2026-09-17 13:14:49 +0000 Commit: Mark Johnston CommitDate: 2026-10-22 15:45:41 +0000 icmp: Limit routing table updates to the FIB of the redirect When we receive an ICMP redirect, rib_add_redirect() is used to apply the redirect to all FIBs. This has been the case since support for multiple FIBs was added. However, it seems rather dubious: the new gateway might not be routable from all FIBs, and the validation done for v4 redirects in icmp_verify_redirect_gateway() is only applied to the FIB from which the redirect originated. Modify the handler to apply the redirect only in the originating FIB. Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai Reviewed by: pouria, zlei, glebius, melifaro MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59567 (cherry picked from commit 01a95394abfdef2adb3216e74d88b9c33321260e) --- sys/netinet/ip_icmp.c | 11 ++++------- sys/netinet6/icmp6.c | 8 +++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index fc0848b2c944..2d769f1d7f9b 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -464,7 +464,6 @@ icmp_input(struct mbuf **mp, int *offp, int proto) int hlen = *offp; int icmplen = ntohs(ip->ip_len) - *offp; int i, code; - int fibnum; NET_EPOCH_ASSERT(); @@ -730,12 +729,10 @@ reflect: break; } - for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rib_add_redirect(fibnum, (struct sockaddr *)&icmpsrc, - (struct sockaddr *)&icmpdst, - (struct sockaddr *)&icmpgw, m->m_pkthdr.rcvif, - RTF_GATEWAY, V_redirtimeout); - } + rib_add_redirect(M_GETFIB(m), (struct sockaddr *)&icmpsrc, + (struct sockaddr *)&icmpdst, + (struct sockaddr *)&icmpgw, m->m_pkthdr.rcvif, + RTF_GATEWAY, V_redirtimeout); break; /* diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 9f2e44f3f6e0..ec2e5a22aa33 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2326,7 +2326,6 @@ icmp6_redirect_input(struct mbuf *m, int off) struct sockaddr_in6 ssrc; struct sockaddr *gw; int rt_flags; - u_int fibnum; bzero(&sdst, sizeof(sdst)); bzero(&ssrc, sizeof(ssrc)); @@ -2345,10 +2344,9 @@ icmp6_redirect_input(struct mbuf *m, int off) rt_flags |= RTF_GATEWAY; } else gw = ifp->if_addr->ifa_addr; - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) - rib_add_redirect(fibnum, (struct sockaddr *)&sdst, gw, - (struct sockaddr *)&ssrc, ifp, rt_flags, - V_icmp6_redirtimeout); + rib_add_redirect(M_GETFIB(m), (struct sockaddr *)&sdst, gw, + (struct sockaddr *)&ssrc, ifp, rt_flags, + V_icmp6_redirtimeout); } freeit: