git: ffad36e1d700 - main - pf: Use MTX_DUPOK to initialize hash chain mutexes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 20 Apr 2026 16:50:22 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=ffad36e1d7002a7da751856b28eb50c36b137abb
commit ffad36e1d7002a7da751856b28eb50c36b137abb
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-04-20 16:48:40 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-04-20 16:50:05 +0000
pf: Use MTX_DUPOK to initialize hash chain mutexes
pf_udp_mapping_insert() may lock more than one row at a time.
Fixes: cd5ff4e841fb ("pf: use hashalloc(9) for key, id, src-node and udp-endpoint hashes")
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D56501
---
sys/netpfil/pf/pf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 4576ad6e41de..dea40816e30f 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -1497,6 +1497,7 @@ retry_waitok2:
UMA_ALIGN_PTR, 0);
ha.size = V_pf_udpendpointhashsize;
ha.lname = "pf_udpendpointhash";
+ ha.lopts = MTX_DEF | MTX_DUPOK;
ha.mflags = M_NOWAIT;
retry_waitok3:
V_pf_udpendpointhash = hashalloc(&ha);