From nobody Thu Oct 22 17:32:26 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 4j9YBM143rz6xPbR for ; Thu, 22 Oct 2026 17:32:27 +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 4j9YBL2gNHz3HcQ for ; Thu, 22 Oct 2026 17:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792690346; 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=TrrT3j9Yr0j02ukzM2sM4HQnBgrkym/t7A/2a/3B2x8=; b=jvxnNOLqLrDa9Cm+MYL4V+UAinfgv+JDXBFYVH3Z5GTzXRJG19P7QyZSmxbNGPc12U99sN yXc6a0OmDDZS6/MW2eQPlOE0E9d0i6unvoRuXd3pfGbNu0UUlLGDmGjYgUZCse2eGr6kXc Q0J81bBJuANrEHzmZvLDUPoIdgrnLKU4hvPiXNIlxY+NrV4zxPtlmYSkzQMy/7xL/cNN+9 /3wwV7YW74o5SKmFPaa7P5eSRvVXjS/J/fVNM3isrtWKCtAFZUeLoPYn1AslQhheDuy0rD 1E2PjDt0ex7bCqnQuT09k8j/oHYtYHSx5WFv5PcD1eE/l+gak6LgccbfrMUx2w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792690346; b=vCodsXA7A7AoHlpuNs7ctGW+PEIQRk/k4dBkNG3QvPZz92pXs9YJmc7/u9yJSlxJMomgl3 2fZ7hoGBDWAA6aLbKnKt58m/52BxEUi+MGWn3Lm5Fsxjn1RpX198gB+VVaSBxTz2o92niL z4qp1cKS3UlyNEbVuK+p8IvpMkr7k+XOl5Ty0SLcByx7JAMiACReCMY0EdQ9GJLkh4IfF1 hyGTE9QKjiWzdYx/TfUFJ51jefUMjuJCYyr+aKho0Q+kfDeMoLJgOO7xr20qbXoRs1NAz7 yqRXtqwZyXcO6Zg7WUO/u20Z/8fxRMYiNix/9gqvx50WxLiaSCXfXsifuZT/Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792690346; 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=TrrT3j9Yr0j02ukzM2sM4HQnBgrkym/t7A/2a/3B2x8=; b=VW5/bv/vgx6on4oxc4x5lgsd2bbt4Ng2r5cqNHjU5HwPdBd9VSJxqcxKjS/FVGijBTQhKK fKdw7jiEdm8yeHEuScdqaFFE2E9s5zRHi2aHhz6qeBlVraCGnXhcJ8wkz85pt/opTQCSIJ Kulf/0N6XBQFOsLA0Nz4WS9QcqMUBh9rSjnGKEgNp6Gu3BzoG76HPeJhRt4eN3lNo+ydtY mSNylpdpSB6PZ7z0mrub8vScf2tNvl1nODBPNcyD+T7ugzAsQi/FdOTtmivC3KCABZ0m60 wNlUWkioc2ssgP5oQpM1jACoSmy1lHFDDVn/yrJhUN+sW8lNUIb2Hpx4HDhoIA== 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 4j9YBL2Hx1zsbl for ; Thu, 22 Oct 2026 17:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ce51 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 22 Oct 2026 17:32:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a4dc618ab4d8 - stable/15 - netipsec: Fix V_spd_size updates List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the 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: a4dc618ab4d866b8686e1c2da2c7d54bd7ea432d Auto-Submitted: auto-generated Date: Thu, 22 Oct 2026 17:32:26 +0000 Message-Id: <6ada48aa.3ce51.60321228@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a4dc618ab4d866b8686e1c2da2c7d54bd7ea432d commit a4dc618ab4d866b8686e1c2da2c7d54bd7ea432d Author: Mark Johnston AuthorDate: 2026-10-08 17:02:51 +0000 Commit: Mark Johnston CommitDate: 2026-10-22 15:45:57 +0000 netipsec: Fix V_spd_size updates key_unregister_ifnet() was erroneously decrementing the size of the global security policy database, V_sptree, but it doesn't modify that database. V_sptree_ifnet is for policies attached to if_ipsec interfaces. Note also that key_register_ifnet() was not incrementing the counter. Move the definition of V_spd_size up to the rest of the SPD definitions. Its inclusion among the SPD cache definitions was confusing to me. Reviewed by: ae Reported by: Stephan de Wit and Cedrik Pischem from OPNsense Sponsored by: OPNsense Sponsored by: Klara, Inc. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60418 (cherry picked from commit 6b1d5fec57f9604a447864ec5e66940126b38df4) --- sys/netipsec/key.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index de1481ba4725..a0a206b6480e 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -183,6 +183,10 @@ static struct rmlock sptree_lock; #define SPTREE_WLOCK_ASSERT() rm_assert(&sptree_lock, RA_WLOCKED) #define SPTREE_UNLOCK_ASSERT() rm_assert(&sptree_lock, RA_UNLOCKED) +/* Size of the SPD */ +VNET_DEFINE_STATIC(unsigned long, spd_size) = 0; +#define V_spd_size VNET(spd_size) + /* Hash table for lookup SP using unique id */ VNET_DEFINE_STATIC(struct secpolicy_list *, sphashtbl); VNET_DEFINE_STATIC(u_long, sphash_mask); @@ -209,8 +213,6 @@ VNET_DEFINE_STATIC(u_int, key_spdcache_maxentries) = 0; #define V_key_spdcache_maxentries VNET(key_spdcache_maxentries) VNET_DEFINE_STATIC(u_int, key_spdcache_threshold) = 32; #define V_key_spdcache_threshold VNET(key_spdcache_threshold) -VNET_DEFINE_STATIC(unsigned long, spd_size) = 0; -#define V_spd_size VNET(spd_size) #define SPDCACHE_ENABLED() (V_key_spdcache_maxentries != 0) #define SPDCACHE_ACTIVE() \ @@ -1410,7 +1412,6 @@ key_unregister_ifnet(struct secpolicy **spp, u_int count) ipsec_accel_spddel(spp[i]); TAILQ_REMOVE(&V_sptree_ifnet[spp[i]->spidx.dir], spp[i], chain); - V_spd_size--; LIST_REMOVE(spp[i], idhash); } SPTREE_WUNLOCK();