Only build secure/libexec/ssh-sk-helper if MK_USB == no
The ssh-sk-helper utility only functions if/when MK_USB == yes.
Installing it on systems where MK_USB == no doesn't make sense.
Differential Revision: https://reviews.freebsd.org/D58246
(cherry picked from commit 4db3872aabc33088cf180599c5eaa23b6f58e6d1)
nfs_clrpcops.c: Fix an mbuf leak introduced by fec497b89b1a
The calls to rpc_free_rdma_reduction() were removed, but I forgot
that newnfs_request() removes the reduction mbuf from the list
upon success, so it has to be free'd separately.
This patch does that.
The patch also disables reduction after the first loop interation.
This is necessary until nfsm_build_rdma_reduction() is patched
to handle an offset within the page array.
Reported by: markj
MFC after: 1 month
Fixes: 884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
cd9660: Fix dereferencing invalid RR outlen ptr
`ISO_RRIP_ANALYZE` is constructed in four places. Two of the
initializers set the `outlen` field while the other two,
`cd9660_rrip_analyze` and `cd9660_rrip_offset`, leave it uninitialized.
The uninitialized paths can dereference an invalid pointer on error
paths which causes a kernel panic.
To fix, I zero out `ISO_RRIP_ANALYZE` in all four places where it's
initialized and check that `outlen` is non-null on the error path
in `cd9660_rrip_loop`.
While testing the above, I encountered another kernel panic due to
mounting continuing after the error branch. Evidently, the ISO continued
mounting through the normal ISO 9660 path then triggered a panic down
the line due to a very broken file system from the ISO. To fix that, I
propagate the error from the RR path then fail in the mount path.
[11 lines not shown]
freebsd-update: sort options alphabetically
This helps future developers when adding additional options handlers in the
surrounding blocks.
This is effectively a no-op.
MFC after: 1 month
(cherry picked from commit 0adec3d7ec96105c402ff2286e402ad63c845066)
tests/sys/netinet/tcp_socket: fix build with ATF 0.22+
Confirm that creating clients/sockets was successful by testing the
result separate from the assignment and test that the return value is
not -1 instead of testing that the value returned is non-zero.
This fixes the build with [ATF 0.22+][1].
MFC after: 2 weeks
Reported by: clang (-Wparenthesis)
Reviewed by: tuexen, cc
Differential Revision: https://reviews.freebsd.org/D59284
[1]: https://github.com/freebsd/atf/pull/72
Conflicts:
tests/sys/netinet/tcp_implied_connect.c
(cherry picked from commit 4aea6ea2eb400737837ff8d22c25688f88c7966c)
contrib/lutok: remove autotools generated files
These files provide no value in the FreeBSD tree proper and change
frequently, depending on what machine I generate the release tarball on
(and what versions of autotools are on the host). Nuke the autogenerated
files to avoid bloating commit history/the tree.
MFC after: 3 days
Requested by: Benjamin Jacobs <freebsd at dev.thsi.be>
(cherry picked from commit cfe443e1e63dd588fba7eabec553ed5e1c408d1f)
sbuf(3): increase test coverage
This change adds additional explicit test coverage for the following
sbuf(3) APIs:
- sbuf_clear_flags
- sbuf_get_flags
- sbuf_set_flags
While here, add a missing `sbuf_delete` to `sbuf_drain_ret0_test`: while
it isn't strictly required (the library's state is cleaned up shortly
after the test process ends), tools such as Coverity and LSAN flag
issues with leaked memory. Adding the sbuf_delete(3) call to the test
quells that issue.
MFC after: 1 week
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2367
(cherry picked from commit 642b3d965eb6ef3ecf733950e66fad565a27c967)
sbuf(3): clean up tests
- Update the copyright dates and add "Joao Bonifacio" to the top of
`sbuf_core_test.c`.
- Use `SPDX-Identifier` instead of longform copyright tort.
- Remove `sbuf_test_common.h`: the header was originally added to help
with the 10.x/11.x split, but is no longer needed given that those
releases have been EOLed for multiple years now.
MFC after: 1 week
(cherry picked from commit 3593be37a49e3f5268259bcc2af58cf730b08335)
contrib/atf: upgrade to 0.26
This new version gets contrib/atf in line with the published version of
the package up on [GitHub][github].
Please note that this release is a major update: it contains several
bugfixes and feature enhancements. Most were already present in the
FreeBSD src repo, but there were a large number of changes made in
addition to what was already present.
MFC after: 1 month
Merge commit '9c78088348bcf1059d82a62bb57a0746309d4312'
(cherry picked from commit 952231086100bed7130212b5425e44ffd732913b)
[github]: https://github.com/freebsd/atf
tests/libc: only build brk_test where libc provides sbrk
Replace the exclusion list with an allowlist of the architectures
whose libc exports brk/sbrk: amd64, i386, arm and powerpc.
On aarch64, riscv and loongarch libc does not export those symbols
and the test cannot run, so do not build it there. New architectures
now default to not building the test unless brk support is added.
MFC after: 1 week
Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007 at gmail.com>
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D60357
(cherry picked from commit 8a7df6c58d549bd2eaa5cad30b2ef93c3eca3c18)
acl(9): expound on NFSv4 constants' meanings
This change adds missing documentation for various NFSv4 constants
supported by acl(9).
Bump `.Dd` for the change.
MFC after: 1 week
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D58736
(cherry picked from commit 7a48c3fd3e6ea097a8fa8f3ce3e25fe7c2d37d9e)
LinuxKPI: firmware: remove `enoentok` logic in `*firmware_request(..)`
Prior to this change, in the event that a firmware module could not be
loaded, the linux_firmware driver would return a partially initialized
structure with uninitialized/zeroed out values for certain fields. Linux
does not do this, however, so some drivers that use
`request_firmware_nowait` expecting Linux behavior, like `if_bcrmfmac`,
would crash trying to dereference a NULL pointer.
This doesn't address the load/unload situation completely as the driver
remains loaded after the "firmware crashes", but it makes a completely
unusable situation (a kernel panic) into a slightly more usable situation
(driver does not unload).
As a sidenote: the raw free(9) call was replaced with a call to
`linuxkpi_release_firmware` because the latter call [better] ensures
that all resources allocated earlier on in the function are cleaned up.
MFC after: 1 weeks
[4 lines not shown]
[tests] lib/libc/gen:assert_test: undefine `NDEBUG`
In the event `NDEBUG` was defined, `assert` would become a no-op,
breaking some of the expectations in `assert_test` around `assert(..)`
failing generating a coredump.
This is a better approach than the previous one committed in 6f3445006a
as it continues to test the `assert(..)` function instead of just
skipping it if `NDEBUG` was defined.
Suggested by: kevans
MFC after: 4 days
MFC with: 6f3445006a
Fixes: 6f3445006a
Differential Revision: https://reviews.freebsd.org/D60253
(cherry picked from commit 9d5a33d9c294b01cead6ff65b0773b5b5ab85ccd)
[tests] lib/libc/gen:assert_test: skip tests when NDEBUG set
In the event that NDEBUG is specified in CFLAGS--which is most likely
triggered via `MK_ASSERT_DEBUG` == "no" -- all assert(3) statements are
optimized out by design. This breaks the assert(3) tests as they
specifically rely on assert(3) actually raising a `SIGABRT` instead of
quietly succeeding.
Skip both tests if `NDEBUG` is set. There's no sense running the
`assert(true)` test if the result could instead be a false positive.
MFC after: 2 weeks
(cherry picked from commit 6f3445006aa05550f14af65b04276c3d25169941)
share/mk/bsd.confs.mk: fix trivial typo in message
The error message noting that the file should not be included said
"bsd.conf.mk" before this change. Now it correctly says "bsd.confs.mk".
MFC after: 3 days
(cherry picked from commit a3214d4e9b661fb173fc25b06b7ee9902b0b57e3)
clk: add config(5) entry for `rk_clk_mmc.c`
This is needed in order to unbreak the build on armv7.
Reported by: Jenkins
Fixes: e32b082ba28b ("clk: rockchip: Add the MMC phase clock")
atf/FREEBSD-upgrade: update document/rewrite in Markdown
The document does not reflect current reality with how updates/releases
should be managed with contrib/atf . Update it to a state that better
reflects current practices with git, as well as information about where
the latest version of the project can be found, etc.
This change will be used as a template for adding instructions on how to
update contrib/kyua and contrib/lutok in future commits.
MFC after: 1 month
Reviewed by: ziaee, carlavilla
Differential Revision: https://reviews.freebsd.org/D59879
ice: Roll back Tx queues after scheduler setup failures
Add Tx LAN Queues commits the PQM queue and PSM leaf before returning
success. ice_ena_vsi_txq() can subsequently fail to create the software
scheduler node or replay its saved bandwidth configuration. Returning
at that point leaves an allocated queue that the caller does not record.
Later queue setup can fail until a function or PF reset removes it.
Issue Disable Tx LAN Queues directly from the completed Add response
before returning a post-add error. Keep the rollback buffer on the
stack so the allocation failure being recovered cannot also prevent
cleanup. Remove any software node and invalidate its queue context only
after firmware accepts the disable. Preserve the queue context and any
software node when rollback fails so active hardware state is not
hidden.
This follows the Add and Disable command lifecycle documented in the
Intel E810 Datasheet, document 613875-003, section 10.5.5.8.
[3 lines not shown]