aboutsummaryrefslogtreecommitdiff
path: root/sys/netipsec
diff options
context:
space:
mode:
authorPawel Biernacki <kaktus@FreeBSD.org>2020-02-26 14:26:36 +0000
committerPawel Biernacki <kaktus@FreeBSD.org>2020-02-26 14:26:36 +0000
commit7029da5c36f2d3cf6bb6c81bf551229f416399e8 (patch)
tree53cae9da1371117a3ac21d0d0f3f030a692807ae /sys/netipsec
parentd7313dc6f5fcab29946951936597772dfff6a4be (diff)
downloadsrc-7029da5c36f2d3cf6bb6c81bf551229f416399e8.tar.gz
src-7029da5c36f2d3cf6bb6c81bf551229f416399e8.zip
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718
Notes
Notes: svn path=/head/; revision=358333
Diffstat (limited to 'sys/netipsec')
-rw-r--r--sys/netipsec/ipsec.c10
-rw-r--r--sys/netipsec/key.c4
-rw-r--r--sys/netipsec/keysock.c3
3 files changed, 11 insertions, 6 deletions
diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c
index 7b7f4d05ea4e..c6454547c5c2 100644
--- a/sys/netipsec/ipsec.c
+++ b/sys/netipsec/ipsec.c
@@ -175,8 +175,9 @@ SYSCTL_DECL(_net_inet_ipsec);
/* net.inet.ipsec */
SYSCTL_PROC(_net_inet_ipsec, IPSECCTL_DEF_POLICY, def_policy,
- CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW, 0, 0, sysctl_def_policy, "I",
- "IPsec default policy.");
+ CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
+ 0, 0, sysctl_def_policy, "I",
+ "IPsec default policy.");
SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_ESP_TRANSLEV, esp_trans_deflev,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_esp_trans_deflev), 0,
"Default ESP transport mode level");
@@ -261,8 +262,9 @@ SYSCTL_DECL(_net_inet6_ipsec6);
/* net.inet6.ipsec6 */
SYSCTL_PROC(_net_inet6_ipsec6, IPSECCTL_DEF_POLICY, def_policy,
- CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW, 0, 0, sysctl_def_policy, "I",
- "IPsec default policy.");
+ CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
+ 0, 0, sysctl_def_policy, "I",
+ "IPsec default policy.");
SYSCTL_INT(_net_inet6_ipsec6, IPSECCTL_DEF_ESP_TRANSLEV, esp_trans_deflev,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_esp_trans_deflev), 0,
"Default ESP transport mode level.");
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index 0be84fb93b2a..e6ffea434f5e 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -508,7 +508,9 @@ SYSCTL_INT(_net_key, KEYCTL_AH_KEYMIN, ah_keymin,
SYSCTL_INT(_net_key, KEYCTL_PREFERED_OLDSA, preferred_oldsa,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(key_preferred_oldsa), 0, "");
-static SYSCTL_NODE(_net_key, OID_AUTO, spdcache, CTLFLAG_RW, 0, "SPD cache");
+static SYSCTL_NODE(_net_key, OID_AUTO, spdcache,
+ CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+ "SPD cache");
SYSCTL_UINT(_net_key_spdcache, OID_AUTO, maxentries,
CTLFLAG_VNET | CTLFLAG_RDTUN, &VNET_NAME(key_spdcache_maxentries), 0,
diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c
index a216f085c1bc..49efa0a3c510 100644
--- a/sys/netipsec/keysock.c
+++ b/sys/netipsec/keysock.c
@@ -431,7 +431,8 @@ struct pr_usrreqs key_usrreqs = {
};
/* sysctl */
-SYSCTL_NODE(_net, PF_KEY, key, CTLFLAG_RW, 0, "Key Family");
+SYSCTL_NODE(_net, PF_KEY, key, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+ "Key Family");
/*
* Definitions of protocols supported in the KEY domain.