summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2024-01-11 14:15:13 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2024-01-11 14:15:13 +0000
commitc8a7281e61f757d243be6a872227eeefaac2fcdc (patch)
treef4df1a2167f2ef0c67f7c333d9e91fc5e1f2b892 /sys/netinet
parent170cf17e3aba02a36e9cc28c8abaa61db2afab26 (diff)
Use domain name for socket lock.
Syzkaller with witness complains about lock ordering of pf lock with socket lock. Socket lock for inet is taken before pf lock. Pf lock is taken before socket lock for route. This is a false positive as route and inet socket locks are distinct. Witness does not know this. Name the socket lock like the domain of the socket, then rwlock name is used in witness lo_name subtype. Make domain names more consistent for locking, they were not used anyway. Regardless of witness problem, unique lock name for each socket type make sense. Reported-by: syzbot+34d22dcbf20d76629c5a@syzkaller.appspotmail.com Reported-by: syzbot+fde8d07ba74b69d0adfe@syzkaller.appspotmail.com OK mvs@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_proto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c
index d2e67c61aae..9748baff7e0 100644
--- a/sys/netinet/in_proto.c
+++ b/sys/netinet/in_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_proto.c,v 1.102 2023/07/06 04:55:05 dlg Exp $ */
+/* $OpenBSD: in_proto.c,v 1.103 2024/01/11 14:15:12 bluhm Exp $ */
/* $NetBSD: in_proto.c,v 1.14 1996/02/18 18:58:32 christos Exp $ */
/*
@@ -387,7 +387,7 @@ const struct protosw inetsw[] = {
const struct domain inetdomain = {
.dom_family = AF_INET,
- .dom_name = "internet",
+ .dom_name = "inet",
.dom_init = in_init,
.dom_protosw = inetsw,
.dom_protoswNPROTOSW = &inetsw[nitems(inetsw)],