tools/git/ghpr: retire
The project under the .../ghpr subdirectory is an earlier version of the
tool. A newer/supported iteration of the tool can be found on
[GitHub][ghpr-repo].
`ghpr` can be installed via `pkg`, e.g., `pkg install py312-ghpr-5`.
Please see the [README.md][readme] for further details.
MFC after: 1 month
[ghpr-repo]: https://github.com/bsdimp/ghpr/
[readme]: https://github.com/bsdimp/ghpr/blob/main/README.md
Reviewed by: dteske
Differential Revision: https://reviews.freebsd.org/D61086
capsicum-test: Disable `HAVE_SEND_RECV_MMSG` again
04c4b2084eb9 accidentally added some changes from another WIP commit into that
diff. Instead of wholesale reverting the change, just revert the part that's
currently broken (`HAVE_SEND_RECV_MMSG`). While some of the related tests pass,
one of the testcases (`capmode.cc:AllowedMmsgSendRecv`) doesn't currently pass.
Revert the change to make the CI run more green again.
MFC after: 1 week
Fixes: 04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
tests/sys/capsicum: restore test coverage with root user
This change builds capsicum_test and installs/runs it as an unprivileged
user ("tests" in vanilla FreeBSD) and root.
This required adjusting logic in the Makefile in order to build two
binaries with the same sources and running them as separate binaries.
Moreover, in order to restore coverage and ensure that some tests which
require `other_uid` (typically specified via `-u` on the CLI with the
test program) don't fail, become the "tests" user when run as root. This
technically doesn't honor unprivileged_user property in kyua.conf: the
property needs to be passed via a command-line parameter to the test
program.
MFC after: 1 week
Reported by: markj
Fixes: 3fb03fb35b20 ("[tests] switch GoogleTest tests ...")
[2 lines not shown]
capsicum-test: make the code WARNS=6 clean
Make the code WARNS=6 clean by doing the following:
- Renaming variables (-Wshadow).
- Use memcpy instead of assigning the result of CMSG_DATA to a variable
(-Wcast-align).
- Wrap some macros with do-while(0) to avoid variable collisions
(-Wshadow).
- Push one of the TRACE statements up by 1 layer to avoid a collision
between 2 calls of TRACE via the same overarching macro.
This was needed in order for the code to build properly with D61066,
since the code was not compiling with WARNS set to 3 at the testcase
level.
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D61080
Revert "capsicum-test: make the code WARNS=6 clean"
The wrong patch got committed somehow from one of my git clones. Revert the
change so I can reapply the correct patch >:(.
This reverts commit 5bae837f316ca96b69c61bae15bd61da76e7f3ea.
Revert "tests/sys/capsicum: restore test coverage with root user"
The wrong patch was applied for D61080. Both changes must go.
This reverts commit dda15b669d021346682009f38acc6db2639fb99f.
tests/sys/capsicum: restore test coverage with root user
This change builds capsicum_test and installs/runs it as an unprivileged
user ("tests" in vanilla FreeBSD) and root.
This required adjusting logic in the Makefile in order to build two
binaries with the same sources and running them as separate binaries.
Moreover, in order to restore coverage and ensure that some tests which
require `other_uid` (typically specified via `-u` on the CLI with the
test program) don't fail, become the "tests" user when run as root. This
technically doesn't honor unprivileged_user property in kyua.conf: the
property needs to be passed via a command-line parameter to the test
program.
MFC after: 1 week
Reported by: markj
Fixes: 3fb03fb35b20 ("[tests] switch GoogleTest tests ...")
[2 lines not shown]
capsicum-test: make the code WARNS=6 clean
Make the code WARNS=6 clean by doing the following:
- Renaming variables (-Wshadow).
- Use memcpy instead of assigning the result of CMSG_DATA to a variable
(-Wcast-align).
- Wrap some macros with do-while(0) to avoid variable collisions
(-Wshadow).
- Push one of the TRACE statements up by 1 layer to avoid a collision
between 2 calls of TRACE via the same overarching macro.
This was needed in order for the code to build properly with D61066,
since the code was not compiling with WARNS set to 3 at the testcase
level.
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D61080
pthread_cond_timedwait.3: list pthread_cond_clockwait as .Nm
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
pthread_cond_timedwait.3: split STANDARDS and HISTORY
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
libthr: libpthread/t_mutex.c tests should expect EDEADLK
to follow the POSIX specification.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
_umtx_op.2: correct the description of the valid _clockid for _umtx_time
And remove the duplicated list from the description of the condition
variable.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
lib/libthr: add helper to check valid clockid to use with _umtx_op(2)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
umtxq_sleep(): do not wait forever for zero absolute timeouts
For msleep(), zero sbt means no timeout. If the timeout was specified as
absolute {0, 0} on MONOTONIC/UPTIME clocks, consider the call timed out
immediately, instead of sleeping until a signal is delivered.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
libthr cond_wait_user(): do not loop forever on clock error
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
pthread_cond_clockwait(3): explicitly reject unacceptable clockids
Otherwise they are rejected by kernel in do_wait(), reached through
_thr_sleep()/UMTX_OP_WAIT_UINT_PRIVATE on the user-mode path. Then,
since cond_wait_user() only leaves its loop on a wakeup, a cancellation
or ETIMEDOUT, the EINVAL from do_wait() results in a loop.
If hit, this indicates a bug in user code, but the system library
must be resilient to such misuse.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
pthread_mutex_timedlock(3): return EDEADLK on detected recursion attempt
for ERRORCHECK and ADAPTIVE_NP mutexes, instead of ETIMEDOUT. This is
explicitly specified by POSIX.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
kern_umtx.c: validate clockid used for _umtx_op(2) timeouts
Only allow clocks that make sense for the umtx_sleep().
While there, do not ignore errors from kern_clock_gettime(). The invalid
clock ids are filtered, but if the clock can't be read (CLOCK_TAI before
the TAI-UTC offset is known), the functions operate on uninitialized
memory.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
libthr: fix __thr_pshared_offpage() to not use cancellable close()
__thr_pshared_offpage() is used by pthread functions that must not be
cancellation points according to POSIX. Use direct __sys_close() instead
of interposed close() there.
Fixes: 1bdbd705993e ("Implement process-shared locks support ...")
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61343
namei(9): allow NDINIT_ATVP() lookups in capability mode
NDINIT_ATVP() initializes dirfd to AT_FDCWD, which is denied for a
process already in cap mode. Since NDINIT_ATVP() is a special lookup
operation performed by the kernel, it should be allowed to proceed for
the paths beneath vp.
Fabricate a pseudo dirfd value that is an unused placeholder,
which fails the AT_FDCWD comparison and allows the lookup to proceed in
cap mode.
Note that failed cap-mode NDINIT_ATVP lookup returned ECAPMODE without
releasing the caller reference on ni_startdir, which is fixed by this
change.
Reported by: ivy
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61315
namei(9): fix restart for NDINIT_ATVP
namei() might restart for altroot or for ERESTART from
nameicap_tracker_add().
vfs_lookup() consumes the reference on ni_startdir and clears it, so
a restarted NDINIT_ATVP() lookup started from the current directory
instead of the vnode passed by the caller.
Save the starting vnode in a local variable, hold it while the lookup
can be restarted, and reference it before the restarted pass. Do not
assert NAMEI_DBG_HADSTARTDIR on the internal restart.
Noted and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61315
link_elf: bounds-check the DT_HASH offset
parse_dynamic() builds the symbol hash table at ef->address + d_ptr
without checking that d_ptr lies within the mapped image, so a crafted
DT_HASH entry causes an out-of-bounds read of the hash header. Reject
the object with ENOEXEC when the header does not fit in the image.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D61323