FreeBSD/src d6915bfsys/fs/nullfs null_vnops.c

nullfs: close a race when syncing inotify flags from the lower vnode

After a bypassed VOP, nullfs mirrors the lower vnode's inotify state
onto the upper vnode.  The flags were checked with lockless reads
before being updated with the asserting flag set/unset primitives, so
two threads syncing the same vnode concurrently (or a sync racing a
watch being established) could both decide to make the same change;
the loser then trips the "flags already set" assertion on an
INVARIANTS kernel.  On other kernels the race is harmless.

Keep the lockless check as the fast path, but re-make the decision
under the vnode interlock before actually changing the flags.

Reproduced in a 4-CPU VM with one thread cycling an inotify watch on
a lower-filesystem file while several threads stat(2) the same file
through a nullfs mount: the unpatched INVARIANTS kernel panics under
this load, the patched kernel runs it to completion.

Fixes:                  f1f230439fa4 ("vfs: Initial revision of inotify")

    [4 lines not shown]
DeltaFile
+14-5sys/fs/nullfs/null_vnops.c
+14-51 files

FreeBSD/src 9b21a52sys/kern sys_process.c

kern_ptrace(): reduce code duplication

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58334
DeltaFile
+15-10sys/kern/sys_process.c
+15-101 files

FreeBSD/src 11edc98sys/amd64/include vm.h, sys/arm/include vm.h

vm: Make sure NULL is defined for vm_memattr_name()

Fixes:  a7e483ee146a ("vm_phys: Add a sysctl to dump registered fictitious memory ranges")
DeltaFile
+2-0sys/amd64/include/vm.h
+2-0sys/arm/include/vm.h
+2-0sys/arm64/include/vm.h
+2-0sys/i386/include/vm.h
+2-0sys/powerpc/include/vm.h
+2-0sys/riscv/include/vm.h
+12-06 files

FreeBSD/src 02c440esys/x86/cpufreq hwpstate_intel.c

hwpstate_intel: Minimize ifdef for i386 build

Reported by:    jrtc27
Fixes:  bdc0f7678257
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
DeltaFile
+0-4sys/x86/cpufreq/hwpstate_intel.c
+0-41 files

FreeBSD/src bdc0f76sys/x86/cpufreq hwpstate_intel.c

hwpstate_intel: Fix i386 build

Reviewed by:    olce
Fixes:  7b26353a59d6
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58208
DeltaFile
+8-0sys/x86/cpufreq/hwpstate_intel.c
+8-01 files

FreeBSD/src 02f1741usr.sbin/certctl certctl.c

certctl: Enforce 0444 mode on new files

When writing to a file, call fchmod() to ensure the file mode matches
the intended mode, which is 0444.  This was already done when replacing
an existing file, but not when creating a new file, which meant if the
process umask was 077, the resulting certificates and bundle would be
unreadable by unprivileged users.

MFC after:      1 week
Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D58304
DeltaFile
+4-0usr.sbin/certctl/certctl.c
+4-01 files

FreeBSD/src cb325dcsys/i386/i386 apic_vector.S

i386: supply thermal interrupt handler

This fixes a build break for i386.

Reviewed by:    kib, olce, Koine Yuusuke <koinec at yahoo.co.jp>
Fixes:  87ba088fa310 ("x86/local_apic.c: Add support for installing a thermal interrupt handler")
Differential Revision:  https://reviews.freebsd.org/D58332
DeltaFile
+15-0sys/i386/i386/apic_vector.S
+15-01 files

FreeBSD/src dc12e3esys/dev/dpaa2 dpaa2_ni.c

dpaa2: Apply if_flags and MAC filters in dpaa2_ni_init()

dpaa2_ni_init() only enabled the DPNI object; it never pushed the
promiscuous/allmulti state or the multicast filter table to the MC
firmware.  The SIOCSIFFLAGS handler ignores flag changes that arrive
while the interface is down, yet still latches them into sc->if_flags,
so a promiscuous mode request made before the first up was silently
lost and could never be applied afterwards: the up path runs
dpaa2_ni_init(), which did not read the flags, and every later
SIOCSIFFLAGS compares against the already-latched value and sees no
change.

This is exactly what happens when if_bridge adds a dpni member while
the dpni is still down, e.g. rc.conf's

    create_args_bridge0="... addm dpni0"

running at bridge clone time, before ifconfig_dpni0="up" is processed.
bridge_ioctl_add() puts the member into promiscuous mode at addm time;

    [18 lines not shown]
DeltaFile
+11-0sys/dev/dpaa2/dpaa2_ni.c
+11-01 files

FreeBSD/src 91b419bsys/arm64/include vm.h

arm64: Fix the build

Fixes:  a7e483ee146a ("vm_phys: Add a sysctl to dump registered fictitious memory ranges")
DeltaFile
+2-0sys/arm64/include/vm.h
+2-01 files

FreeBSD/src a7e483esys/amd64/include vm.h, sys/arm/include vm.h

vm_phys: Add a sysctl to dump registered fictitious memory ranges

I've wanted this a couple of times in the past.  Save the memattr in
the fictitious memory segment structure so that we can report it from
the sysctl handler, and add conversion routines for each platform.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58283
DeltaFile
+41-0sys/vm/vm_phys.c
+23-2sys/arm64/include/vm.h
+25-0sys/powerpc/include/vm.h
+23-0sys/amd64/include/vm.h
+23-0sys/i386/include/vm.h
+19-0sys/arm/include/vm.h
+154-21 files not shown
+171-27 files

FreeBSD/src cbd442eusr.sbin/bhyve smbiostbl.c bhyve_config.5

bhyve: add configurable SMBIOS OEM Strings

Add the option "oemstring" to allow setting the DMI type 11 ("OEM
Strings") SMBIOS structure. These are free-form strings, available for
any purpose, but can be especially useful to pass configuration,
secrets, and credential information into a Linux guest and consumed by
systemd.

MFC after:      1 month
Relnotes:       yes
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57516
DeltaFile
+124-0usr.sbin/bhyve/smbiostbl.c
+3-0usr.sbin/bhyve/bhyve_config.5
+127-02 files

FreeBSD/src 2038232sys/kern kern_sig.c

thread_stopped(): style

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+2-2sys/kern/kern_sig.c
+2-21 files

FreeBSD/src 506e3e3sys/netinet tcp_input.c

tcp: Align PRR implementation with RFC 9937

- Early return when no new data is delivered
- Switching from PRR-CRB to PRR-SSRB only when both SND.UNA advances and no further loss is indicated.
- Accounting for sequence ranges SACKed before entering recovery in RecoverFS calculation.
- Force a fast retransmit upon entering recovery when prr_out is 0 AND SndCnt is 0.
- Set cwnd to ssthresh post recovery.

Obtained from: mohnishhemanthkumar_gmail.com
Reviewed by: rscheff, tuexen
Differential Revision: https://reviews.freebsd.org/D56535
MFC after: 3 months
DeltaFile
+23-21sys/netinet/tcp_input.c
+23-211 files

FreeBSD/src a51fdcesys/fs/nfs nfsclstate.h, sys/fs/nfsclient nfs_clstate.c

nfs_clstate.c: Fix handling of delegation upgrades

Commit 016570c4463d modified the client to handle
the upgrade of a read delegation to a write delegation,
where the server provides the same delegation stateid
to the client.  However, it failed to check if the
delegation structure was currently in use.  Without this
patch, if the structure was in use, a use after free
could occur.

This patch handles the "in use" case by copying the
necessary fields into the current/old structure and
free's the new one instead of the old one that is
"in use".

PR:     296224

(cherry picked from commit fe6677e7f440d1aa52de036639efc55047ab9a2b)
DeltaFile
+36-9sys/fs/nfsclient/nfs_clstate.c
+4-2sys/fs/nfs/nfsclstate.h
+40-112 files

FreeBSD/src 299bbb7sys/fs/nfs nfsclstate.h, sys/fs/nfsclient nfs_clstate.c

nfs_clstate.c: Fix handling of delegation upgrades

Commit 016570c4463d modified the client to handle
the upgrade of a read delegation to a write delegation,
where the server provides the same delegation stateid
to the client.  However, it failed to check if the
delegation structure was currently in use.  Without this
patch, if the structure was in use, a use after free
could occur.

This patch handles the "in use" case by copying the
necessary fields into the current/old structure and
free's the new one instead of the old one that is
"in use".

PR:     296224

(cherry picked from commit fe6677e7f440d1aa52de036639efc55047ab9a2b)
DeltaFile
+36-9sys/fs/nfsclient/nfs_clstate.c
+4-2sys/fs/nfs/nfsclstate.h
+40-112 files

FreeBSD/src 672345csys/fs/tmpfs tmpfs_vnops.c

tmpfs: implement AT_RENAME_EXCHANGE

(cherry picked from commit 7e06c33151e7664f6d664ee282d8da1985ce94aa)
DeltaFile
+68-24sys/fs/tmpfs/tmpfs_vnops.c
+68-241 files

FreeBSD/src feb4c9dsys/fs/tmpfs tmpfs_vnops.c

tmpfs: extract tmpfs_rename_check/set_parent() from tmpfs_rename()

(cherry picked from commit 5e0b96e728af9916ac59d65e37155a95e06c3b5e)
DeltaFile
+89-78sys/fs/tmpfs/tmpfs_vnops.c
+89-781 files

FreeBSD/src 5dc55ccsys/fs/tmpfs tmpfs_vnops.c

tmpfs_rename(): style

(cherry picked from commit 631b8ff9318a83b985d3a8a790dd0fc1bab9d5cd)
DeltaFile
+2-2sys/fs/tmpfs/tmpfs_vnops.c
+2-21 files

FreeBSD/src 090fff7lib/libsys rename.2

rename.2: Document AT_RENAME_EXCHANGE

(cherry picked from commit 3055c47f6024b087a90021edb05992304a119827)
DeltaFile
+6-0lib/libsys/rename.2
+6-01 files

FreeBSD/src e0fe823sys/kern vfs_syscalls.c, sys/sys fcntl.h

renameat(2): add AT_RENAME_EXCHANGE flag

(cherry picked from commit 8e6e77ec25bc5809500d29bf318a843b40205657)
DeltaFile
+57-13sys/kern/vfs_syscalls.c
+2-0sys/sys/fcntl.h
+59-132 files

FreeBSD/src 123dfd3sys/arm64/vmm/io vgic_v3.c

arm64/vmm: Fix vgic_v3 dropping EOI for disabled IRQs

Now that IRQs can properly be disabled by GICD_ICENABLERn, an EOI for a
disabled IRQ ends up being lost, since we don't assign it to a list
register and don't enable maintenance interrupts for such cases. As a
result, we keep the IRQ active, which stops it from ever being delivered
again (which would be true even if we supported the active and pending
state). Keep disabled but active IRQs around in list registers so we can
see the EOI having taken place in a future sync (noting that since we
already don't create list registers in active and pending state there
are no concerns with causing a disabled IRQ to be delivered).

Fixes:          47e073941f4e ("Import the kernel parts of bhyve/arm64")
MFC after:      1 week
DeltaFile
+7-1sys/arm64/vmm/io/vgic_v3.c
+7-11 files

FreeBSD/src 422a530sys/arm64/vmm/io vgic_v3.c

arm64/vmm: Fix vgic_v3 copy paste error for writing to GICD_ICENABLERn

Otherwise we try to disable the wrong IRQ.

Fixes:          47e073941f4e ("Import the kernel parts of bhyve/arm64")
MFC after:      1 week
DeltaFile
+1-1sys/arm64/vmm/io/vgic_v3.c
+1-11 files

FreeBSD/src 8a16004sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: stop ieee80211_start_tx_ba_session() if no HT supported

rtw89(4) would constantly try to start a TX BlockACK session even if no
HT or higher was available.  The only way to stop this (currently) is
to return -EINVAL instead of any other error.

Note: we should investigate if/when to call (*set_tid_config)() as that
will also offer the ability to forbid BA.

Sponsored by:   The FreeBSD Foundation
Reported by:    arved, bnovkov
Tested by:      bnovkov
MFC after:      3 days
DeltaFile
+1-1sys/compat/linuxkpi/common/src/linux_80211.c
+1-11 files

FreeBSD/src d7ea4aa. CLAUDE.md, include ucl.h

libucl: Import libucl 0.9.4

Changelog: https://github.com/vstakhov/libucl/releases/tag/0.9.4
DeltaFile
+82-0CLAUDE.md
+27-4src/ucl_util.c
+23-0include/ucl.h
+13-0tests/basic/issue312.res
+9-3src/ucl_emitter.c
+8-4tests/CMakeLists.txt
+162-116 files not shown
+196-1412 files

FreeBSD/src 1403ca1sbin/ipf/ippool ippool.5, sys/netinet/libalias libalias.3

man: Fix RFC 1918 network prefix lengths

According to RFC 1918, the following IP prefixes are reserved for
private internets:

    10.0.0.0/8
    172.16.0.0/12
    192.168.0.0/16

This PR fixes the prefix lengths in references to private networks
("RFC 1918 networks", "the standard private IP address ranges").
The changes are limited to man pages.

Signed-off-by:  Yusuke Ichiki <public at yusuke.pub>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2328
MFC after:      3 days
DeltaFile
+2-2sys/netinet/libalias/libalias.3
+1-1sbin/ipf/ippool/ippool.5
+3-32 files

FreeBSD/src e4795d3sys/compat/linuxkpi/common/include/linux skbuff.h, sys/compat/linuxkpi/common/src linux_skbuff.c

LinuxKPI: skbuff: add initial page pool support

Add an internal flag which is set by skb_mark_for_recycle() and upon
"skb_free" then selects whether the skb is freed or returned to the
page pool.
There will likely be more details to figure out once the LinuxKPI page
work is done and we support more of the page pool than the bare minimum.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+8-1sys/compat/linuxkpi/common/src/linux_skbuff.c
+3-2sys/compat/linuxkpi/common/include/linux/skbuff.h
+11-32 files

FreeBSD/src cb13e82sys/compat/linuxkpi/common/src linux_skbuff.c

LinuxKPI: skbuff: add reference counting to the skb

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+21-0sys/compat/linuxkpi/common/src/linux_skbuff.c
+21-01 files

FreeBSD/src c589dc4sys/modules/mt76/core Makefile, sys/modules/mt76/mt7921 Makefile

mt76: disable debugfs due to missing piece still in review

Until D57524 is not reviewed and committed we will have a missing
function declaration which prevents us to compile (in) debugfs for
mt76 core and mt7921.  Temporary disable debugfs again.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+1-1sys/modules/mt76/core/Makefile
+1-1sys/modules/mt76/mt7921/Makefile
+2-22 files

FreeBSD/src 1e4ec01sys/compat/linuxkpi/common/src linux_skbuff.c

LinuxKPI: skbuff: add support for frags in linuxkpi_skb_copy()

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+10-4sys/compat/linuxkpi/common/src/linux_skbuff.c
+10-41 files

FreeBSD/src 32c9834sys/compat/linuxkpi/common/include/linux skbuff.h

LinuxKPI: skbuff: add skb_put_zero()

Add skb_put_zero() as a simple wrapper around __skb_put_zero().

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+7-1sys/compat/linuxkpi/common/include/linux/skbuff.h
+7-11 files