HardenedBSD src tree
Go to file
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
.cirrus-ci
.github
bin import terminus-font-4.49.1 2022-02-02 14:26:09 +02:00
cddl zfs: merge openzfs/zfs@17b2ae0b2 (master) into main 2022-01-22 23:05:15 +01:00
contrib Apply fix for ThreadSanitizer false positive data race reports 2022-02-07 19:39:02 +01:00
crypto OpenSSL: Fix the same BIO_FLAGS macro definition 2022-02-01 10:38:49 -08:00
etc Append Keyboard Layout specified option for using VNC. 2022-01-20 23:49:27 +01:00
gnu
include Change the return value of _Unwind_GetCFA in include/unwind.h. 2022-01-27 14:42:40 -08:00
kerberos5
lib strftime.3: Fix a typo and use St for standards 2022-02-07 15:14:47 +01:00
libexec rtld: Fix assertion I broke. 2022-01-27 14:42:40 -08:00
release pkgbase: Remove runtime dependency on bootloader 2022-01-14 10:52:08 +01:00
rescue
sbin dmesg: detect wrapped msgbuf on the kernel side and if so, skip first line 2022-02-05 13:35:31 -08:00
secure
share tcp: Add hystart++ to our cubic implementation. 2022-02-07 06:37:46 -05:00
stand stand/efi: Pass --no-dynamic-linker to ld.bfd >= 2.34. 2022-02-02 12:18:43 -08:00
sys pbuf_ctor(): lock the buffer with LK_NOWAIT 2022-02-07 10:05:20 -09:00
targets
tests Stop single stepping in signal handers on arm64 2022-02-07 15:03:23 +00:00
tools update external URL 2022-02-05 20:04:00 +00:00
usr.bin ipsec(4): Fix a few typos in error messages 2022-02-06 13:43:42 +01:00
usr.sbin Fix too small sscanf output buffers in kbdmap 2022-02-06 16:25:25 +01:00
.arcconfig
.arclint
.cirrus.yml
.clang-format
.gitattributes
.gitignore .gitignore: Restore inadvertently deleted file 2022-01-18 08:00:42 -08:00
COPYRIGHT
LOCKS
MAINTAINERS
Makefile import terminus-font-4.49.1 2022-02-02 14:26:09 +02:00
Makefile.inc1 Remove more quotes around Makefile .error/.warn/.info strings. 2022-02-04 15:59:53 -08:00
Makefile.libcompat Makefile.libcompat: Sort 2022-02-02 14:34:29 -07:00
Makefile.sys.inc
ObsoleteFiles.inc ObsoleteFiles: move libelf.so.2 to MOVED_LIBS 2022-01-30 16:35:02 -05:00
README.md
RELNOTES
UPDATING Fix minor grammar nit. 2022-01-31 15:35:23 -08:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING and gnu/COPYING.LIB for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources.
sys/arch/conf Kernel configuration files. GENERIC is the configuration used in release builds. NOTES contains documentation of all possible entries.
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.