HardenedBSD/sys
Robert Wing c9e023541a pbuf_ctor(): lock the buffer with LK_NOWAIT
This LOR happens when reading from a file backed MD device:

lock order reversal:
 1st 0xfffffe00431eaac0 pbufwait (pbufwait, lockmgr) @ /cobra/src/sys/vm/vm_pager.c:471
 2nd 0xfffff80003f17930 ufs (ufs, lockmgr) @ /cobra/src/sys/dev/md/md.c:977
lock order pbufwait -> ufs attempted at:
    #0 0xffffffff80c78ead at witness_checkorder+0xbdd
    #1 0xffffffff80bd6a52 at lockmgr_lock_flags+0x182
    #2 0xffffffff80f52d5c at ffs_lock+0x6c
    #3 0xffffffff80d0f3f4 at _vn_lock+0x54
    #4 0xffffffff80708629 at mdstart_vnode+0x499
    #5 0xffffffff807060ec at md_kthread+0x20c
    #6 0xffffffff80bbfcd0 at fork_exit+0x80
    #7 0xffffffff810b809e at fork_trampoline+0xe

This LOR was previously blessed by witness before commit 531f8cfea0
("Use dedicated lock name for pbufs").

Instead of blessing ufs and pbufwait, use LK_NOWAIT to prevent recording
the lock order. LK_NOWAIT will be a nop here as the lock is dropped in
pbuf_dtor(). The takes the same approach as 5875b94c74 ("buf_alloc():
lock the buffer with LK_NOWAIT").

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D34183
2022-02-07 10:05:20 -09:00
..
amd64 xen: switch to use headers in contrib 2022-02-07 10:11:56 +01:00
arm tegra: Fix a common typo in source code comments 2022-02-06 17:31:05 +01:00
arm64 Stop single stepping in signal handers on arm64 2022-02-07 15:03:23 +00:00
bsm
cam cam(4): Fix a few typos in source code comments 2022-02-06 13:45:47 +01:00
cddl
compat lindebugfs: Fix write 2022-02-04 14:31:08 +01:00
conf tcp: move ECN handling code to a common file 2022-02-05 15:04:42 +01:00
contrib xen: import Xen 4.16 public headers in sys/contrib/ 2022-02-07 10:11:56 +01:00
crypto
ddb
dev usb(4): Belatedly add a PCI device ID for AMD Bolton chipset 2022-02-07 13:48:09 -05:00
dts dts: add IPQ4018/IPQ4019 ethernet MAC and ethernet switch definitions 2022-02-03 21:26:45 -08:00
fs fs: fix a few common typos in source code comments 2022-02-06 13:48:31 +01:00
gdb
geom
gnu
i386 xen: switch to use headers in contrib 2022-02-07 10:11:56 +01:00
isa
kern kern_fflock: Fix a typo in a source code comment 2022-02-06 17:29:43 +01:00
kgssapi
libkern
modules rtsx: Convert driver to use the mmc_sim interface 2022-02-03 18:43:12 -05:00
net if_vxlan(4): Allow netmap_generic to intercept RX packets. 2022-02-06 15:27:46 +03:00
net80211
netgraph
netinet tcp: Add hystart++ to our cubic implementation. 2022-02-07 06:37:46 -05:00
netinet6
netipsec
netpfil pf: deal with tables gaining or losing counters 2022-02-05 10:29:34 +01:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed
opencrypto
powerpc powerpc/atomic: Fix atomic_testand_*_long on powerpc64 2022-02-03 17:25:39 -06:00
riscv
rpc
security
sys
teken
tests
tools
ufs ffs_read(): lock buffers after snaplk with LK_NOWITNESS 2022-02-06 03:26:22 +02:00
vm pbuf_ctor(): lock the buffer with LK_NOWAIT 2022-02-07 10:05:20 -09:00
x86 xen: switch to use headers in contrib 2022-02-07 10:11:56 +01:00
xdr
xen xen: remove public headers in sys/xen/interface 2022-02-07 10:12:34 +01:00
Makefile