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
+8-4tests/CMakeLists.txt
+9-3src/ucl_emitter.c
+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

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

LinuxKPI: skbuff: implement __skb_linearize()

skb_linearize() is used by mt7921, mt7925, and in the general mt76 tx dma
code. __skb_linearize() is used in the general iwlwifi TX code but given
the way we currently create TX skbs in LinuxKPI 802.11 we never hit that
case.

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

FreeBSD/src b36460esys/compat/linuxkpi/common/include/linux skbuff.h

LinuxKPI: skbuff: implement napi_build_skb()

Implement napi_build_skb() around linuxkpi_build_skb().

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

FreeBSD/src e5bcf7bsys/compat/linuxkpi/common/include/linux skbuff.h

LinuxKPI: skbuff: improve debugging

Deal with SKB_TRACE_FMT optional arguments; while here properly indent.

Add KASSERT to __skb_unlink() to catch incorrect skbuffs encountered
while debugging a wireless driver (which had other pre-conditions failing).

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

FreeBSD/src d0b1a38usr.bin/awk/tests/bugs-fixed bug_fix_test.sh

awk/tests: xfail inf-nan-torture on riscv64

The fix for this is being tracked upstream here:
https://github.com/onetrueawk/awk/issues/269

While here, just cd into $SRCDIR while executing tests,
since the test engine isolates every testcase's working
directory. This ensures that the xfail actually applies
to the next command.

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
DeltaFile
+8-4usr.bin/awk/tests/bugs-fixed/bug_fix_test.sh
+8-41 files

FreeBSD/src d809a10sys/vm vm_page.h vm_page.c

vm_page: Fix dequeue on arches with weak ordering

A vm_page's a.queue field records the page queue index for the page
queue to which the page belongs.  The PGA_ENQUEUED flag indicates
whether the page is actually enqueued in that queue's TAILQ.  When
modifying the a.queue field, you need to hold the page queue lock for
the queue corresponding to the old value, unless the old value is
PQ_NONE.

Suppose a managed page is freed.  vm_page_free_prep() calls
vm_page_dequeue_deferred(), which checks whether the page belongs to a
queue; if so it schedules an asynchronous dequeue operation so that page
queue lock acquisitions can be batched if possible.

The dequeue operation must be completed before the page's plinks.q
fields are reused.  So, during page allocation, we call
vm_page_dequeue() to finish the dequeue operation.  Similarly, since the
buddy allocator uses the plinks.q fields for its own internal linkage,
vm_freelist_add() calls vm_page_dequeue().

    [17 lines not shown]
DeltaFile
+32-0sys/vm/vm_page.h
+24-2sys/vm/vm_page.c
+56-22 files

FreeBSD/src 2f1ec7dsys/kern kern_time.c

ktimer: Check for errors from realtimer_gettime()

clock_gettime(CLOCK_TAI) can fail, leaving *ovalue uninitialized.

Reported by:    Hazley Samsudin of GovTech CSG
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58225
DeltaFile
+5-2sys/kern/kern_time.c
+5-21 files

FreeBSD/src 82aca8epackages/sound Makefile

packages/sound: Add dependency on bsdconfig

Since the devd rules use sysrc, bsdconfig should be installed.

MFC after:      3 days
DeltaFile
+3-0packages/sound/Makefile
+3-01 files

FreeBSD/src dd9fac5sys/dev/firewire if_fwe.c if_fwip.c

firewire: remove SPL calls

SPL is a no-op on amd64. Real locking is already handled by fc_mtx and
per-driver mutexes.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D58210
DeltaFile
+2-21sys/dev/firewire/if_fwe.c
+2-20sys/dev/firewire/if_fwip.c
+2-19sys/dev/firewire/firewire.c
+4-16sys/dev/firewire/fwohci.c
+3-13sys/dev/firewire/fwdev.c
+1-9sys/dev/firewire/sbp_targ.c
+14-982 files not shown
+14-1078 files

FreeBSD/src 2b9ed8dshare/man/man4 fwdv.4, sys/dev/firewire fwdv.c

fwdv: match unit directories instead of IDENTIFY

Migrated fwdv to use per-unit-directory child device

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58204
DeltaFile
+26-87sys/dev/firewire/fwdv.c
+9-5share/man/man4/fwdv.4
+35-922 files

FreeBSD/src c402d2eshare/man/man4 fwisound.4, sys/dev/firewire fwisound.c

fwisound: match unit directories instead of IDENTIFY

Migrated fwisound to use per-unit-directory child device

Differential Revision:  https://reviews.freebsd.org/D58203
Reviewed by:    adrian
DeltaFile
+50-116sys/dev/firewire/fwisound.c
+3-2share/man/man4/fwisound.4
+53-1182 files

FreeBSD/src 58bd896share/man/man4 fwcam.4, sys/dev/firewire fwcam.c fwcam.h

fwcam: match unit directories, defer probe to first open

Migrated fwcam to use per-unit-directory child device

Differential Revision:  https://reviews.freebsd.org/D58202
Reviewed by:    adrian
DeltaFile
+98-102sys/dev/firewire/fwcam.c
+15-2share/man/man4/fwcam.4
+5-3sys/dev/firewire/fwcam.h
+118-1073 files

FreeBSD/src 2114347share/man/man4 firewire.4, sys/dev/firewire firewire.c firewirereg.h

firewire: per-unit-directory child device support

Added structure to allow multiple device to attach to the same driver.
Also removed the deprecation warning from the man page.

Differential Revision:  https://reviews.freebsd.org/D58201
Reviewed by:    adrian
DeltaFile
+213-16sys/dev/firewire/firewire.c
+53-0sys/dev/firewire/firewirereg.h
+25-1share/man/man4/firewire.4
+6-4sys/dev/firewire/if_fwe.c
+6-4sys/dev/firewire/if_fwip.c
+6-4sys/dev/firewire/sbp_targ.c
+309-291 files not shown
+313-307 files

FreeBSD/src 9da8f0esys/kern sys_generic.c

kern: fix compilation

uintptr64_t -> uint64ptr_t

Fixes:  5cafd6213f145 (exterr_set: sync the definition with the header declaration)
DeltaFile
+2-2sys/kern/sys_generic.c
+2-21 files