nfs_clsubs.c: Fix ncl_getcookie() when "pos" is negative
In ncl_getcookie(), a very large value for "off" for
a directory can result in "pos" being set to a bogus
value (including a negative one), due to truncation.
When "pos" is negative, is can skip past the
while (pos >= NFSNUMCOOKIES) loop and return a
bogus pointer instead of NULL.
This patch changes the type to u_int and also adds
a sanity check for a very large "off" to ensure that
a NULL pointer is returned for this case.
This bug has been in the code for decades and I am
not aware of any report of it causing a problem for
users.
Reviewed by: markj
Reported by: Joshua Rogers of AISLE Research Team
[2 lines not shown]
eventhandler: Fix the NODEBUG build
Reported by: Michael Butler <imb at protected-networks.net>
Fixes: 735b16d490ae ("eventhandler: Fix a race when pruning eventhandlers")
devmatch: read linker.hints from all module paths
Previously, devmatch would stop at the first linker.hints file
found in kern.module_path. This meant modules installed in
/boot/modules/ were invisible to devmatch if /boot/kernel/
contained a linker.hints file (which it always does).
Merge hints from all directories in kern.module_path.
This allows third-party or out-of-tree kernel modules in
/boot/modules/ to be auto-loaded by devmatch just like
built-in modules.
Reviewed by: imp
Differential Revivion: https://reviews.freebsd.org/D56847
man: Kill off MANSUBDIRs
Three architecture dependent manuals are installed to MANSUBDIRs,
creating at least two empty manual page directories on everyone's
boxxen. Move those manuals to their canonical area, enhancing clarity,
grepability, removing useless inodes, and increasing consistency with
the rest of the architecture dependent manuals which are unconditionally
installed, and noted at the top of the rendered manual.
MFC after: 3 days
(cherry picked from commit 809504f331fd3588e36b54255196379bdb59890a)
ports.7/FILES: Expand and refactor into 3 tables
Add make.conf, CHANGES, CONTRIBUTING.Md, UPDATING, and Tools/scripts.
Refactor the FILES section of the ports reference manual into a bigger
table with three sections separated by root directory. Remove preceeding
article from all but "the big Kahuna", and root dirs where reasonable.
MFC after: 3 days
Relnotes: yes
Reported by: adamw, arrowd, linimon
Differential Revision: https://reviews.freebsd.org/D55441
(cherry picked from commit 28deec9b7e2b08b00160eb39de84ade6f27eb125)
if_vlan: Use the exclusive lock everywhere
Running sys/net tests in parallel reveals some panics which look like
the one below:
```
shared lock of (sx) vlan_sx @ /home/markj/sb/main/src/sys/net/if_vlan.c:2395
while exclusively locked from /home/markj/sb/main/src/sys/net/if_vlan.c:1850
panic: excl->share
cpuid = 9
time = 1776467219
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00d84e0780
vpanic() at vpanic+0x136/frame 0xfffffe00d84e08b0
panic() at panic+0x43/frame 0xfffffe00d84e0910
witness_checkorder() at witness_checkorder+0xdb1/frame 0xfffffe00d84e0ad0
_sx_slock_int() at _sx_slock_int+0x64/frame 0xfffffe00d84e0b10
vlan_ioctl() at vlan_ioctl+0x25c/frame 0xfffffe00d84e0b70
if_setflag() at if_setflag+0xdc/frame 0xfffffe00d84e0be0
[27 lines not shown]
eventhandler: Fix a race when pruning eventhandlers
By default, eventhandler_deregister() blocks until it reaches some point
where no threads are invoking the event. At this point, it knows that
1) no threads are currently executing the handler,
2) some thread has freed the eventhandler structure by virtue of having
called eventhandler_prune_list(),
so it is safe to return.
Suppose a thread is trying to deregister an event handler. A different
thread prunes it, and wakes up the first thread. Before the first
thread runs, a third thread grabs the event handler lock, and starts
executing handlers. The first thread observes el_runcount > 0, and goes
back to sleep. The third thread sees no event handlers to prune, and
doesn't wake up the first thread, which sleeps forever.
This change fixes the race and tries to make eventhandler_invoke() more
efficient: keep a count of the number of dead list entries and only
prune the list if there is at least one dead entry. Also, in
[7 lines not shown]
graphics/blender: Fix build after switch to NumPy 2.x
"ld: error: unable to find library -laudaspace-py"
This happens because configure can't find numpy and because of this the
shared library libaudaspace-py.so won't compile:
-- numpy found at '/usr/local/lib/python3.11/site-packages'
CMake Warning at build_files/cmake/macros.cmake:1210 (message):
Python package 'numpy' include dir path could not be found in:
'/usr/local/lib/python3.11/site-packages/numpy/core/include',
'/usr/local/lib/python3/site-packages/numpy/core/include',
'/usr/local/lib/python3.11/dist-packages/numpy/core/include',
'/usr/local/lib/python3/dist-packages/numpy/core/include',
'/usr/local/lib/python3.11/vendor-packages/numpy/core/include',
'/usr/local/lib/python3/vendor-packages/numpy/core/include',
The 'WITH_PYTHON_NUMPY' option will be disabled.
[11 lines not shown]
vt_core: don't draw the splash if a panic occurred
The shutdown splash draws over all the useful info if ddb(4) is
disabled. Don't draw the splash screen if we're rebooting because of a
panic.
MFC after: 3 days
(cherry picked from commit bc83f414583ccaf337ef3b7c019df7727d6a3aae)