From nobody Thu Oct 08 18:19:19 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 4j0yv11ZJmz6w2bs for ; Thu, 08 Oct 2026 18:19:25 +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 4j0yv10j98z4GKR for ; Thu, 08 Oct 2026 18:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791483565; 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=rT+70uhpPvUycZn3rMDTujA8uB9fxTZqI8ZOkdi6wgY=; b=Epz4ky2rsBkCuHNZbq6DZ0dG9LiHdc8zWYx2D0JpmWcNUZqfeUOLYpf6Sm6I9vGzb+5MU4 PJGItWkTAuNfPJPUolawplZbSuj4zdkb/t+eBJdY4tvcAo9EeqfQYtcK3LW6Qs74TmaDbG hnzjcw1GS++MTY+CjKHznUelOuasrEj2IZZj21F/3vuik9412pUs8oFa4nm5KvmopigtdH 2EBpnv3vXoltVHj+5ENLPG00EJ4UV/2tSyPoa9WJlcuo+CsFLsci+wuuVHnjm7tD3UJavd 8NdGfteMNqWC0zPUsdX+SKaefBq8UGmLPVJdXTzrGldM5bkz4DhNxK+8CXSlpw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791483565; b=B0T3Q44PYV0lWkk7lHILbE1CHx4Bi+UIrfNUYEHKmheSLPUVeGsmT3mG21Q13tvBJkJlhZ 2fJ6LfHcyLWhDcey3YEH8GLXIWZ5rCXhEgDNqiFnmlRxPHiOY3vQtM84zBO3XvyBJehR+4 8tivkEZ4+EM0+i/G91QMG+mKXr3W2Y3YguFA4sLjXDHVuCy63tG1rE7z9URy37Ebg6toAt 5H+HPNKmQyNBA4DLTeyg9QMf65WnSS6cEHu5ProRUuKYhzYzYVqxRfIA6sZ8Lg4/izGPMx 7W2Ok01xo5lIWAB13wC+Fn2QCp0UB7/9P0y0/EcJzAklHe+eBfdwm63gJe5iOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791483565; 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=rT+70uhpPvUycZn3rMDTujA8uB9fxTZqI8ZOkdi6wgY=; b=G0isLY4NIcdc+Y1+1ZFk6fRNkgammg07KfFCsiUhdKRA9jxPybcMf9ReRzdVVgRKkF1h31 DQyrhWYKUGcy5hU/z4TtX4xxz6KNEtZ2jNQl97lYUlqZ0bQALfYQnBdXvDJ+m4CJOeaaXb 7CtkT5XvoJYBzlleUZ+//mr4Vw2exQF5isT5x15n0BqqissYyq3xmvzRt3fLAN3QCsPoc9 PxUlbiqdxlSBu5AX3ID5vuqjtDa6Sx1SGHGAQ5OOk1eXnXat08Fb9WH4o8nCmw3qA9+9dc dBZRZEUgaNkgeQACRM9c+AU15ujxvnjUCZcpVZe7klzWOg5iBavht8Kqt3PeXQ== 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 4j0yv06TGHzrBx for ; Thu, 08 Oct 2026 18:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19e38 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 08 Oct 2026 18:19:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6b1d5fec57f9 - main - netipsec: Fix V_spd_size updates 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b1d5fec57f9604a447864ec5e66940126b38df4 Auto-Submitted: auto-generated Date: Thu, 08 Oct 2026 18:19:19 +0000 Message-Id: <6ac7dea7.19e38.f3fda7b@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6b1d5fec57f9604a447864ec5e66940126b38df4 commit 6b1d5fec57f9604a447864ec5e66940126b38df4 Author: Mark Johnston AuthorDate: 2026-10-08 17:02:51 +0000 Commit: Mark Johnston CommitDate: 2026-10-08 18:16:56 +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 --- 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();