linux_file.c: Fix handling of NFS getdents() emulation
Bugzilla PR#292282 reports a problem, where a Linux
binary running in the Linuxulator gets bogus entries
in a readdir()/getdents() reply when the directory is
an NFS mount.
This appears to be caused by the NFS client including
entries with d_fileno == 0, which are always ignored by
BSD, but are not ignored by Linux.
This patch filters out the "d_fileno == 0" entries and
the reporter of the bugzilla PR notes that it fixes the
problem for him.
It could be argued that the NFS client should filter out
the "d_fileno == 0" entries, but the NFS client readdir
code is "fragile" and any change to it runs a significant
risk of causing regression type problems.
[7 lines not shown]
pipe: Avoid unnecessary priv_check() calls in pipespace_new()
Running out of pipe map KVA is a rare case, so reorder checks
accordingly, presuming that calling priv_check() is more expensive than
the calculation. In particular, priv_check() might not be cheap to
evaluate if MAC hooks are installed.
Reviewed by: olce, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D55378
sysctl: Avoid calling priv_check() unnecessarily
After commit 7d1d9cc440f80 we only serialize large sysctl requests for
non-root users, but we should avoid calling priv_check() unless the
request actually is large, as that's not the common case. In
particular, priv_check() might not be cheap to evaluate if MAC hooks are
installed.
Reviewed by: olce, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D55377
CONTRIBUTING.md: Github to Phabricator move adivce
When moving from Github to Phabricator, request that the original github
pull request be closed with the URL of the Phab. This cuts down on
clutter and helps us track things better.
Sponsored by: Netflix
loader.efi: efi_redirect_exceptions does use uninitialized pointer
loader_idt.rd_base is not set when we are attempting to bcopy(),
resulting to data stored to page 0 and therefore corrupting it.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D55180
loader.efi: free_tables() appears to free tss_pa twice.
we check and reset loader_gdt_pa, but use FreePages(tss_pa).
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D55179
sound: Detect unsupported formats
This way we can avoid edge-cases like
8af6aee96ed609456900c6dd92dafabac5e89c0a ("virtual_oss(8): Remove
floating point formats from preference list").
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D55403
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): 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]
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