linuxkpi: Add `usleep_range_state()`
It takes a task state as its last argument. We enforce that this state
is `TASK_UNINTERRUPTIBLE` for the time being because other states are
not interpreted.
Change `usleep_range()` to call `usleep_range_state()` with the state
set to `TASK_UNINTERRUPTIBLE`, which is what Linux does too.
The amdgpu DRM driver starte to use `usleep_range_state()` in Linux
6.13.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57579
linuxkpi: Add `to_acpi_device_node()` and `ACPI_COMPANION()`
The former is called by the latter. We return NULL because linuxkpi does
not implement ACPI (pseudo?) devices associated to regular devices.
The amdgpu DRM driver started to use `ACPI_COMPANION()` in Linux 6.13.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57577
generic_ehci_fdt: fix driver softc size
This subclass declares its own softc structure adding necessary members
after the embedded ehci_softc_t. The full size of the struct must be
included in the driver declaration, otherwise the allocation backing the
softc is not guaranteed to be large enough.
Reported by: KASAN
Reviewed by: jrtc27, manu
Fixes: 7a58744fd0f1 ("Split out the attachment from the generic-ehci driver")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57951
(cherry picked from commit d5332d3a904242cb82e7dbf35e4aeec7c2df4402)
stand/libofw: make OF_hasprop() part of the library
Currently it is only needed by powerpc ofwfdt.c, and defined statically
there. Make it available as part of libofw, mirroring what we have in
the kernel.
Two small tweaks are made to the implementation:
1. Return type is changed to bool
2. Return 'true' when OF_getproplen() == 0. This matches the expected
semantics of the kernel version, described in OF_hasprop(9).
Reviewed by: manu, imp, adrian
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56429
(cherry picked from commit 48a05f833c7d0c089d37522cc234039ec823edf4)
raspberry_virtgpio: fix OF_hasprop() usage
The function returns a bool. This driver was merged recently (by me) and
I missed this instance.
While here, adjust the ofw_bus_status_okay() call similarly. This
function still returns an int, but this usage is more widely used in our
drivers.
No functional change intended.
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Fixes: b60cd486a652 ("ofw: bool-ify OF_hasprop()")
(cherry picked from commit ce6b4973ba8c6503d3b6dc12d9e6b42ce274d912)
OF_getprop.9: update OF_hasprop() signature
The return type has been converted to a bool.
Reported by: manu
Sponsored by: The FreeBSD Foundation
Fixes: b60cd486a652 ("ofw: bool-ify OF_hasprop()")
(cherry picked from commit 47b0ac1cadc91eee5e98813169b590c443135fbc)
clk_fixed: quiet a warning message
Frequently there are some unused/unspecified fixed clocks present in a
device tree. Each one emits a warning before it fails to attach, which
results in (sometimes many) repeated messages which are not
user-actionable.
Put this warning behind the bootverbose flag.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56204
(cherry picked from commit 8728e21bd694dbb813c149206c5c89290f9c32f5)
ofw: bool-ify OF_hasprop()
Adjust the function signature and the few callers that don't treat it
this way already.
This is style only; no functional change intended.
Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56203
(cherry picked from commit b60cd486a652f0427e525b4482ac598be5460459)
netinet6: Fix ND link-layer address option layout for IPoIB
RFC 4391 (IP over InfiniBand), section 9.3, lays the ND source/target
link-layer address option out as type, length (3), two reserved zero
octets, then the 20-octet IPoIB link-layer address.
The ND code assumed the Ethernet layout (RFC 4861, section 4.6.1)
everywhere and read/wrote the address directly after the option
header, i.e. two octets early.
The option-length sanity check computes 24 for both layouts for
a 20-octet address, so the mismatch was silent.
PR: 296585
Reviewed by: adrian, pouria
Sponsored by: VersatusHPC
Differential Revision: https://reviews.freebsd.org/D58096
OpenSSH: Update to 10.4p1
Full release notes are available at
https://www.openssh.com/txt/release-10.4
Selected highlights from the release notes:
Potentially-incompatible changes
--------------------------------
* sshd(8): configuration dump mode ("sshd -G") now writes directives
in mixed case (e.g. "PubkeyAuthentication") whereas previously it
emitted only lower-case names.
* ssh(1), sshd(8): make the transport protocol stricter by
disconnecting if the peer sends non-KEX messages during a post-
authentication key re-exchange. Previously a malicious peer could
continue sending non-key exchange messages without penalty. These
would be buffered, causing memory to be wasted up until the
[69 lines not shown]
ipfw nat: Add assertion that mbuf is not a chain
Discarding m_free's return value will result in an mbuf leak if the mbuf
was in a chain.
In general we should use m_freem if the mbuf may be in a chain, or
assert that the return was NULL. There will not be a chain here due to
m_megapullup, so add an assert.
Reviewed by: ae
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57479
(cherry picked from commit b16c731b0191d6c47de46a3c6057b0c5ec0dd420)
inotify: Unconditionally generate IN_IGNORED events for files/dirs
The implementation previously only generated an IN_IGNORED event for a
deleted watched file if the watch explicitly requested IN_DELETE_SELF.
This is not correct, IN_IGNORED should always be raised when the watched
subject is deleted. Adjust the implementation of inotify_log_one()
accordingly.
This also fixes a problem where a deleted watched file's watch
would not be removed if IN_DELETE_SELF was not in the watch's event
mask, in which case the unlinked vnode would linger until the inotify
descriptor itself is closed.
Add a regression test.
Reported by: jrtc27
Reviewed by: jrtc27
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D58050
[2 lines not shown]
inotify: Ensure that "allocfail" is initialized in inotify_log_one()
Fixes: b70997c8c75a ("inotify: Unconditionally generate IN_IGNORED events for files/dirs")
(cherry picked from commit f370bf9fafce82851bedb2b88bc21ec6ca0182df)
infiniband/core/ib_addr.c: fix typo
We should exit the net epoch instead of acquiring one more entry.
Reported by: Wafa Hamzah <wafah at nvidia.com>
Reviewed by: jhb
Sponsored by: Nvidia networking
Fixes: 4726b80d9379 ("OFED: Various changes from Linux 4.20")
Differential revision: https://reviews.freebsd.org/D58127
vtfontcvt: Return error from write_fnt_source
Previously write_fnt_source always returned 0, silently discarding
errors. Return rv so that errors set vtfontcvt's shell exit
appropriately.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit f05fb5157ba1291ee5019bacece8d1e98ea95b35)
newvers.sh: Avoid spurious -dirty in git revision
If git is installed and .git exists but git rev-parse failed to report a
hash we previously produced just "-dirty" as the git revision. Gate the
git commit count and -dirty check on the rev-parse passing.
Reviewed by: jlduran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57995
(cherry picked from commit 465a3b7adc008c068741594f6c922ede98924f39)
(cherry picked from commit 45da2c1e1d202ab190f156dd63403be79fb11e94)
newvers.sh: Avoid spurious -dirty in git revision
If git is installed and .git exists but git rev-parse failed to report a
hash we previously produced just "-dirty" as the git revision. Gate the
git commit count and -dirty check on the rev-parse passing.
Reviewed by: jlduran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57995
(cherry picked from commit 465a3b7adc008c068741594f6c922ede98924f39)
epoch: Fix epoch_drain_callbacks()
This function is supposed to wait until all pending callbacks have been
executed. This is useful in some contexts where we tear down some
context (like a VNET jail and its associated UMA zones) synchronously,
and we want to make sure that all pending asynchronous callbacks (which
may free objects to said UMA zones) have run first.
The implementation schedules a callback on each CPU and waits for them
all to run. This assumes that, on a given CPU, callbacks are executed
in the order that they are pushed. This assumption depends on the
implementation of epoch_call_task() and ck_epoch_poll_deferred(), and it
is not true in general.
Callbacks are pushed onto a per-CPU stack in LIFO order.
ck_epoch_poll_deferred() first pulls out the callbacks from epoch - 2,
which are always safe to execute, and in so doing reorders them such
that the oldest callback as at the top of the stack, so in this case,
epoch_call_task() will execute them in order. However,
[22 lines not shown]
inotify: Ensure that "allocfail" is initialized in inotify_log_one()
Fixes: b70997c8c75a ("inotify: Unconditionally generate IN_IGNORED events for files/dirs")
taskqueue: Avoid unbounded epoch read sections
The taskqueue thread loop tries to avoid entering and exiting net epoch
read sections for every task. This reduces the overhead of net epoch
integration, but the implementation wasn't bounding the length of the
read section, so a busy taskqueue thread could hold an epoch open for an
unbounded period. This is easy to achieve with the epair task, for
instance.
Bound the number of tasks that we'll execute without observing the
global epoch, and provide a sysctl to control it. Let the default bound
be eight.
Reviewed by: glebius
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58031
timefd: Correct the required rights for timerfd_gettime()
Reviewed by: jfree
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58084