ip6: Add explicit lock order information to catch LOR

Over the past several years, we have had sporadic reports of a lock
order reversal between the tcphash lock and the in6_ifaddr_lock.
These seems to be hard to reproduce reliably, and the WITNESS backtrace
points to code which uses the correct locking order.

This commit adds the correct lock order explicitly to help us detect
the call stack which uses the incorrect locking order.

PR:		289184
Reported by:	bz, gbe
Reviewed by:	bz, glebius
Differential Revision:	https://reviews.freebsd.org/D54088
This commit is contained in:
Jonathan T. Looney
2025-12-05 17:34:31 +00:00
parent 6f4debc004
commit 3f10e59850
+6
View File
@@ -566,6 +566,12 @@ static struct witness_order_list_entry order_lists[] = {
{ "tcp", &lock_class_mtx_sleep },
{ "so_snd", &lock_class_mtx_sleep },
{ NULL, NULL },
/*
* IPv6 Addr
*/
{ "tcphash", &lock_class_mtx_sleep },
{ "in6_ifaddr_lock", &lock_class_rm },
{ NULL, NULL },
/*
* BPF
*/