From nobody Sun Aug 16 20:25:20 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 4hNSBm4nbyz6pYpn for ; Sun, 16 Aug 2026 20:25:20 +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 4hNSBm27Pzz3wrl for ; Sun, 16 Aug 2026 20:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786911920; 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=38VZJxhqRuO0xZoF+F4TzvHcR5TlQoUvi/liAuDuflY=; b=L+LNZnTZILn0gUqOtX9mND7JVV3e6UcEbq7oSoDSQh8PhrYC+7+jDfUh6QfM/k56vDuNV+ odgSt/6amN4rz7VGcH5Y0cFpYRVAy35STanGxKeohighw36+bDJb1PDaDvWJJuhimUmr8C 8+UsXpHpEMw6u6j1D6yBXEvdJLYCBL4SJo0S2d9vrzDxwIjQRXk4x68JrrT8MTxw+1C7Yg RsJtL3f6xB1Rq5gbKgIX6xBR+HG4CV6Uu7MLd8Rn/Cv297bBxP5/L7Rlcxr0T7CGh4tqnL 150+Hq5CPfoVjxKlKmVezoyA/7G6G2iiZIuReDYRlvBpi7y6n8kNgnVGY+YmaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786911920; a=rsa-sha256; cv=none; b=D+xoD7j4j615UUqhbYZfajrp8hVnKjtI8Sq3UB/8Dk30AfGEy2JaY/EDwRTVlRhuOG2TcA h2b5N5pRHWfBVeY7k2LQ817k6Yw3oigjlgzC4V1y0e9py75ht4QRlSI+tGENkdRrEQdXwr hQze0YvKcUVgw4f5KFlDJIZA3rviYN9wiD1cmX2IHm4jd6y3myY4lYvvV1pXKviQcgAvjA LVTEJ8gqfIFhJm5et4wCFUXRImQVBKU+V50ZSYGMpLV2J9BoCvoha7kAJVIxHmeBmVn8Ux oX3jiSy3ATDi44Yy+CicQlMQ2Jfy9jjXpoF/C2vkf2elw8cw36Si7JgllnN6ew== 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=1786911920; 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=38VZJxhqRuO0xZoF+F4TzvHcR5TlQoUvi/liAuDuflY=; b=YERYLYs92r2scN1k7KF2T34usY3SmorR39U75gtNLWYeeXjVXyZpRfSYBZjz3tF3fae3D9 Us7E4p2Zs3vugXP858rgBuMmpchEND3Mnn8PZ46eQBeSxWzkhb3YvP32akSdATByzU9ct9 czyvzYNdzN0pizDMx2J2u6tAUl6i6OurrcFrP49POMP0v9jGVuLvB6VVtIKZta7M2/XCYo 2VfV3rIp9s5eXQCZd+CebkX4mRuQoCOJZdruRdYgfwFflWYjwHDjZvuhXXz+w5IxZ5vFkf yHVGZI6ttRpFMVWd+4HTp1DLdDXiC2Px4kSnRk5czQiGJzHy6+W7/8DpPAQZdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hNSBm139pzkWb for ; Sun, 16 Aug 2026 20:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46b09 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 16 Aug 2026 20:25:20 +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: 5614daf09f71 - stable/15 - ifnet: Restore previous size of if_afdata List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/15 X-Git-Reftype: branch X-Git-Commit: 5614daf09f71232b1118d2687228d5dc2b9ce520 Auto-Submitted: auto-generated Date: Sun, 16 Aug 2026 20:25:20 +0000 Message-Id: <6a821cb0.46b09.17cca154@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5614daf09f71232b1118d2687228d5dc2b9ce520 commit 5614daf09f71232b1118d2687228d5dc2b9ce520 Author: Dag-Erling Smørgrav AuthorDate: 2026-08-14 08:23:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-08-16 20:24:58 +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 8ee7d3f3f924..a38998b5c02e 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1119,7 +1119,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 a5cc09127f6f..76e4cdbf40c2 100644 --- a/sys/net/if_private.h +++ b/sys/net/if_private.h @@ -101,7 +101,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. */