reap_kill_subtree_once(): reap_kill_proc_work() might drop proctree_lock
Due to this, restart the iteration over the p_reapsiblings if the lock
was dropped.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55288
procctl(PROC_REAP_KILL): align error reporting with pgkill(2)
ESRCH from cr_cansignal() means that the target process should be not
visible to the initiator. So do not report pids with ESRCH result.
Noted by: markj
Reviewed by: markj, olce
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55341
procctl(PROC_REAP_KILL): use pgrp pg_killsx sx to sync with fork
PROC_REAP_KILL must guarantee that all reaper descendants are signalled.
In particular, it must ensure that forked but not yet fully linked
descendants cannot escape killing. Currently, proc_reap() fullfils the
guarantee by single-threading stopping the target process, which moves
the target to the userspace boundary, so the target cannot fork while
the signal is sent.
Single-threading has undesirable effect of sometimes terminating sleeps
with EINTR.
Since the time that the bug with PROC_REAP_KILL was fixed, we grow
the pg_killsx mechanism that is similarly used by the process group
signalling to ensure that no member of the process group escapes.
Reuse pg_killsx for PROC_REAP_KILL as well.
Besides the functional change of no longer causing spurious EINTR, not
single-threading the target means that we no longer need to delegate the
[9 lines not shown]
loader.efi: tss_pa setup seems to be flawed in trap.c
since sd_lobase is 24 bits, we would need to shift 24 bits, not 16.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D55178
asmc: code style modernization and minor cleanups
- Allow `ASMC_DEBUG` to be treated as a variadic macro.
- Add ellipses around `sizeof(..)` calls.
- Reindent some of the lines to better follow style(9) with line
wrapping.
A number of other clang-format changes were not taken as they are not
compatible with style(9).
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55394
libfetch: Gracefully skip unsupported protocols
If socket() fails because the address family or protocol is unsupported,
just continue with the next address.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55407
libfetch: Fail hard if interrupted while connecting
This fixes an issue where the first address that DNS returns is blocked
by a packet filter, so we hang for a while, then the user hits Ctrl-C,
interrupting connect(2), whereupon we move on to the next address, get
a connection, request the file, and return to fetch(1), which sees that
SIGINT was caught and bails.
Note that we make no attempt to enforce fetchTimeout in the connection
phase, and never have. It's feasible, but non-trivial, so we'll leave
it as an exercise for future us.
PR: 293312
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55406
libfetch: Clean up fetch_info usage
* Provide a wrapper for the common if (verbose) fetch_info(...) idiom.
* Replace remaining instances of fprintf(stderr, ...) with fetch_info().
* Fix a few style nits.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55405
libnetbsd: import `__CTASSERT(..)` macros
These compile-time assert macros are similar to `Static_assert` on FreeBSD.
These macros are in use in newer versions of `contrib/netbsd-tests`.
Obtained from: https://github.com/NetBSD/src (c26cc77b3a0b26b95a2)
MFC after: 1 week
tcp: improve validation of received TCP over UDP packets
Reviewed by: glebius, pouria
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D55410
nvmf: Limit the default I/O queue size to 128 entries
Previously the size defaulted to the maximum supported size reported
by the remote host. The value of 128 matches the default on Linux and
avoids excessive resource usage for I/O queues.
Sponsored by: Chelsio Communications