shm: Zero struct kinfo_file in sysctl handler
Reported by: Calif.io in collaboration with Claude and Anthropic Research
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55806
(cherry picked from commit 25cc459286a02b646751541ccde5a33319471c73)
ifnet: Fix decreasing the vnet interface count
It should be decreased only when the interface has been successfully
removed from the "active" list.
This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".
Reviewed by: kp, pouria
Fixes: a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D55873
(cherry picked from commit 8065ff63c0e5c3bb4abb02f55b20cb47bb51d1a7)
(cherry picked from commit 1b7687f053afcf251ee7643ee5a4f22a225f4a02)
ifnet: Fix decreasing the vnet interface count
It should be decreased only when the interface has been successfully
removed from the "active" list.
This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".
Reviewed by: kp, pouria
Fixes: a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D55873
(cherry picked from commit 8065ff63c0e5c3bb4abb02f55b20cb47bb51d1a7)
timerfd: Suppress kqueue readability after jump read
Do not report EVFILT_READ after reading a discontinuous clock jump.
This makes the kqueue filter consistent with Linux epoll behavior
and timerfd_poll(), which already checks tfd_jumped != TFD_READ before
reporting POLLIN.
MFC after: 2 weeks
timerfd: Wake up on discontinuous jump
If a discontinous realtime clock change occurs and sets any TFD_JUMPED
bits on the timerfd, then wake up waiting readers. This fixes failures
from the timerfd_root__clock_change_notification test case.
MFC after: 2 weeks
sys/time: Add saturating sbt conversions
When converting from timespec to sbintime, the timespec's 64-bit tv_sec
component is shifted to the left 32 bits, causing any information in the
upper 32 bits to be lost.
This data loss during conversion can turn timespecs with very large
tv_sec counters into sbintimes that represent much smaller time
durations.
Add tstosbt_sat() and tvtosbt_sat(), which are saturating versions of
tstosbt and tvtosbt. With these routines, any overflow resulting from
the conversion is clamped to [-SBT_MAX - 1, SBT_MAX].
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D55791
MFC after: 2 weeks
timerfd: Add tests
Take Jan Kokemuller's timerfd tests from the epoll-shim project,
stripping out code that isn't directly related to FreeBSD.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55789
MFC after: 2 weeks
timerfd: Use saturating sbintime conversions
Some timerfd consumers set expirations with timespec tv_sec components
larger than 2^31 - 1. In such cases, converting that timespec to
sbintime results in data loss or sign flip, yielding a shorter
expiration than desired.
To avoid this problem, use saturating timespec-to-sbintime conversion
functions. These will clamp the converted sbintime to SBT_MAX under
circumstances where the normal conversion functions would overflow.
Saturating conversions still result in data loss, but the consequences
are less severe, causing problems only after SBT_MAX (~68 years) of
system uptime elapses.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55792
MFC after: 2 weeks
timerfd: Fix interval callout scheduling
When a timerfd interval callout misses its scheduled activation time, a
differential is calculated based on the actual activation time and the
scheduled activation time. This differential is divided by the timerfd's
interval time and the quotient is added to the timerfd's counter.
Before this change, the next callout was scheduled to activate at:
scheduled activation time + timerfd interval.
This change fixes the scheduling of the next callout to activate at:
actual activation time + timerfd interval - remainder.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55790
MFC after: 2 weeks
libcrypto: compile all PIC objects with -DOPENSSL_PIC
This change modifies the libcrypto PIC objects to always compile with
`-DOPENSSL_PIC` to restore parity with the upstream build process. This
ensures that `-DOPENSSL_PIC` is used whenever building the auxiliary
shared objects. In this case, just the legacy provider (we no longer
distribute the fips provider).
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44896
ath11k: restore module Makefile
During the subtree merge and checking out the updated version of ath12k
parts of the previous ath11k merge were accidentally undone.
Retore the ath11k Makefile as well after 3c4eef5d838b restored the
driver bits.
Fixes: a96550206e4b ("ath12k: update Atheros/QCA's ath12k ..")
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
ath11k: reduce diff to upstream Atheros/QCA's ath11k driver
It seems that over the time of merging and only partly working
on making it compile again a few mis-merges happened.
Reduce diff to the v6.19 upstream version so that we only have
additions to the driver (usually guarded by #ifdef __FreeBSD__).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
ath12k: update Atheros/QCA's ath12k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
05f7e89ab9731565d8a62e3b5d1ec206485eeb0b ( tag: v6.19 ).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
ath11k: update Atheros/QCA's ath11k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
zfs: merge openzfs/zfs at 3ee08abd2
Notable upstream pull request merges:
#17000 -multiple cmd/zfs: support creating parents with canmount=no
#17926 b481a8bbb Make zpool status dedup table support raw bytes -p output
#18238 -multiple Report space metrics per allocation class
#18240 5dad9459d Add --no-preserve-encryption flag
#18257 1eace5906 libzfs: use mount_setattr for selective remount including
legacy mounts
#18259 1e2c94a04 More consistent use of TREE_* macros in AVL comparators
#18262 c58b8b7dc Fix check for .cfi_negate_ra_state on aarch64
#18264 f109c7bb9 Add the --file-layout (-f) option to zdb(8)
#18268 304de7f19 libzfs: handle EDOM error in zpool_create
#18275 753f1e1e2 zstream: add a drop_record subcommand
#18276 0f90a797d Fix vdev_rebuild_range() tx commit
#18277 1e1d64d66 Fix log vdev removal issues
#18278 06b0abfe6 Fix the send --exclude option to work with encryption
#18281 e73ada771 libzpool: lift zfs_file ops out to separate source file
#18284 d97945776 zstream: consolidate shared code
[19 lines not shown]
bridge(4): Remove epoch_enter during destruction
bridge doesn't require to enter epoch during destruction.
Reviewed by: zlei, glebius
Differential Revision: https://reviews.freebsd.org/D55935