diff options
| author | Jonathan T. Looney <jtl@FreeBSD.org> | 2025-12-05 17:34:31 +0000 |
|---|---|---|
| committer | Jonathan T. Looney <jtl@FreeBSD.org> | 2025-12-06 19:58:46 +0000 |
| commit | 3f10e5985044001a68761995474f1100aca648e1 (patch) | |
| tree | 2fcd028d495afb99371ec6f2a9e96a1e1dde60c3 | |
| parent | 6f4debc004c31a2bd846757859e67855ab3d4c8d (diff) | |
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
| -rw-r--r-- | sys/kern/subr_witness.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index c937f6a82757..abed76315c34 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -567,6 +567,12 @@ static struct witness_order_list_entry order_lists[] = { { "so_snd", &lock_class_mtx_sleep }, { NULL, NULL }, /* + * IPv6 Addr + */ + { "tcphash", &lock_class_mtx_sleep }, + { "in6_ifaddr_lock", &lock_class_rm }, + { NULL, NULL }, + /* * BPF */ { "bpf global lock", &lock_class_sx }, |
