From nobody Sun Aug 16 20:25:21 2026 X-Original-To: dev-commits-src-all@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 4hNSBp3mF0z6pYl9 for ; Sun, 16 Aug 2026 20:25:22 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hNSBn4zmXz3x0n for ; Sun, 16 Aug 2026 20:25:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786911921; 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=tRU43WxSftlGI1tAKb4Xs44+JqNFhNq1jlwT9NlpaGo=; b=gkXmsW6j1Ya0qWBvxinY2pIQbUDdXyHvkErwCwlBsajebpxm4WM/bvmEhnVRiPROCogNJk du0K3+oh396Hwoz/Px4xobdY4fZC6TPb9AokDmdMdH9KZXnPUrYsyXXvg+WYY/OvvnwH7O omyfwyQcCe1mvs41xa+jq1BtDX90NEwAoYSYGGVDvmsNXTaUF2C3ljNe+Ej6PerFHRf0HE mVZ+x1rrE5mV0Ef5/Vuq3PWWUrEDFrdwZbS7qUqDjFvVYwLWfg3B188cGHb3zpw4vQQO6O 1ujYMY7tUOu8ANxn13TLstbyHFLYYc68CmvVEfhT9Xw/NrvHu0v6nrfZbAIGIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786911921; a=rsa-sha256; cv=none; b=YKkzMimN7yz1dvKyK031IUjf0n1nOiUsaYdOGbrrUt30UCSvMUYT6pBaZs1tkSnQA6tN6J 7SfbaqrPEWRu0gqBsuvE00zB4H2XRNGtS54u1IXn9DiSu53hi2gJNDmXS8ZW59di2pj9T5 LMDBM+YsW/P+r0cKOFe1NcpsGh63BO5M/mx0WjN7c76OlsHkPub6KwpfpQRBBVHnoX2YEs nTcBTHW2KBPuAkYDbzx4xZ5EhdCkLCjfXYRXTlXYiCnd59cSOSKDTtDBR8MXkrRlFYHDsS 9p90NAnfIzplDq8G4gaB2IfARyu1SLD3GKfBCmXtMQGzmDFbcnZA4t0m/xKRYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786911921; 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=tRU43WxSftlGI1tAKb4Xs44+JqNFhNq1jlwT9NlpaGo=; b=GGqig1a/ZCzwtN/Zb/wGv2Y+e4FHat6qOgMN4GYuqcrplrjFHvTegjC7l5b0IlI3GxHr3X tTGMdj67/9tiJnqyaq7LanvGxJoaYHBO8ijiVHX/BmbwOOa84H7lh9o5vYs5mmnr3tPygo QuddgmksEEOKuVgDuIY1eiavmqlUR99Vmmr+gvop3h+AFBDKQsdDUwz2Ar/uwKgdRwF0O4 ReNCGaamVfm2WZzoK94l7L1wb6L+2TUjhJGA3q62FZ3y1P3RAUBRhWE15b+2creyJRgOfj JigigB4UBkqS3rL8XsY5FBuKLIyivBjWBSFu1aLX3ddLklEMiRpcdm7ryPakpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hNSBn41ZtzkRD for ; Sun, 16 Aug 2026 20:25:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44a32 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 16 Aug 2026 20:25:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: c78ab620bb1f - stable/14 - ifnet: Restore previous size of if_afdata List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c78ab620bb1fed047451babc6921732a5d091e4c Auto-Submitted: auto-generated Date: Sun, 16 Aug 2026 20:25:21 +0000 Message-Id: <6a821cb1.44a32.4b19655b@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c78ab620bb1fed047451babc6921732a5d091e4c commit c78ab620bb1fed047451babc6921732a5d091e4c Author: Dag-Erling Smørgrav AuthorDate: 2026-08-14 08:23:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-08-16 20:25:00 +0000 ifnet: Restore previous size of if_afdata Struct ifnet contains an array if_afdata of AF_MAX pointers to address information for each possible address family. Since 2013, when AF_MAX was inadvertently changed to be equal to the highest possible value, instead of one more than the highest possible value, this array has been too small in theory, but this never mattered in practice because the higher address families were not assignable to interfaces. My recent commit which corrected the value of AF_MAX had the side effect of breaking the KBI by changing the size and layout of struct ifnet. This manifested itself as kernel panics when using third-party network drivers and went unnoticed in main because if_afdata no longer exists there. Address the issue for stable/15 and stable/14 by keeping the correct value of AF_MAX but deliberately making if_afdata off by one, restoring its previous size. Fixes: ddd850aa7720 ("sys/socket.h: Fix AF_MAX") Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D58840 --- sys/net/if.c | 2 +- sys/net/if_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index b3ab75144460..7856f53a3cea 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1123,7 +1123,7 @@ if_detach_internal(struct ifnet *ifp, bool vmove) struct ifaddr *ifa; int i; struct domain *dp; - void *if_afdata[AF_MAX]; + void *if_afdata[nitems(ifp->if_afdata)]; #ifdef VIMAGE bool shutdown; diff --git a/sys/net/if_private.h b/sys/net/if_private.h index 8802b08c6a05..b605f5342abe 100644 --- a/sys/net/if_private.h +++ b/sys/net/if_private.h @@ -103,7 +103,7 @@ struct ifnet { void *if_hw_addr; /* hardware link-level address */ const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ struct mtx if_afdata_lock; - void *if_afdata[AF_MAX]; + void *if_afdata[AF_MAX - 1]; /* off by one for historical reasons */ int if_afdata_initialized; /* Additional features hung off the interface. */