kern: add a security knob to disable unprivileged access to kenv
We sometimes store sensitive things in the kenv that get zapped, but we
really shouldn't rely on that zapping to actually happen. Most
unprivileged processes don't really need to read from the kernel
environment in the first place, so add a knob that allows it to be
disabled.
Note that we consider jailed root to be unprivileged from this
perspective; they have their own meta/env concepts and we should
encourage users to take advantage of those for passing information to
jails.
"Hey we should do something about that": dch
Reviewed by: imp, ziaee, zlei (all slightly previous version)
Differential Revision: https://reviews.freebsd.org/D57697
amdsmu(4), acpi_spmc(4): Fix ordering of calls
The AMD SMU is supposed to be notified of suspension the SPMC has been,
and conversely on resume, as expressed in comments.
Fix the EVENTHANDLER(9) priorities used so that they match the
comments. Lower values indeed indicate higher priority in this
subsystem.
Reviewed by: obiwac
Fixes: 2c60fce365f4 ("amdsmu: Sleep entry/exit hints for PMFW")
Event: Halifax Hackathon 202606
Sponsored by: The FreeBSD Foundation
etcupdate: Recommend building when bootstrapping
Since building is no longer the default, add -b to the bootstrapping
examples as they are likely to be run with a tree that hasn't been
built.
MFC after: 1 week
Fixes: ddf6fad0295a ("etcupdate: Make nobuild the default")
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D57643
etcupdate: Warn if the tree hasn't been built
Warn the user before trying `make installetc` if etcupdate was invoked
without -b (or with -B) and it appears that `make buildetc` hasn't
already been run (which usually happens as part of `make buildworld`).
MFC after: 1 week
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D57504
RDMA: dma-mapping: use unsigned long for dma_attrs
Tested by: Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Tested by: John Baldwin <jhb at FreeBSD.org> (iw_cxgbe)
Obtained from: Linux commit 00085f1efa387a8ce100e3734920f7639c80caa3
Sponsored by: Chelsio Communications
OFED: Implement ib_process_cq_direct
This is largely pulled from the original Linux commit to add cq.c.
Note that irq_poll is still not supported, but polling should now be
possible whereas it wasn't really before.
Tested by: Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Tested by: John Baldwin <jhb at FreeBSD.org> (iw_cxgbe)
Obtained from: Linux commit 14d3a3b2498edadec344cb11e60e66091f5daf63
Sponsored by: Chelsio Communications
OFED: Use vmalloc() and vzalloc() in various places
This contains changes from the following Linux commits:
10313cbb9220 IPoIB: Allocate priv->tx_ring with vmalloc()
b1404069f644 IPoIB/cm: Use vmalloc() to allocate rx_rings
948579cd8c6e RDMA: Use vzalloc() to replace vmalloc()+memset(0)
Tested by: Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Tested by: John Baldwin <jhb at FreeBSD.org> (iw_cxgbe)
Sponsored by: Chelsio Communications
OFED: Use prandom_u32() to reduce diff with upstream
Tested by: Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Tested by: John Baldwin <jhb at FreeBSD.org> (iw_cxgbe)
Sponsored by: Chelsio Communications
rtld: Check for -1 as an-end-of-section marker
rtld calls functions in the .init_array section one at a time, until
it finds a distinguished sentinel value. The C runtime does the same
thing (in crtend.c). However, that checks for the sentinel -1 and not
1. If one is using a linker that unifies .ctors and .init_array, then
rtld will miss the sentinel value. I believe the author of this code
intended to write -1 instead of 1. Indeed, changing the code to also
check for -1 prevents rtld from attempting to call a non-existent
function. The same is true of .dtors and .fini_array.
Signed-off-by: Daniel Levin <daniellevin2607 at gmail.com>
Reviewed by: kib
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/2270