FreeBSD/src b86e364tools/tools/git git-mfc

git-mfc: Improve handling of remotes

If we can't figure out which remote to use, print a useful error instead
of assuming that "freebsd" is the right remote to use.
DeltaFile
+5-5tools/tools/git/git-mfc
+5-51 files

FreeBSD/src 7392dc9tools/tools/git git-mfc

git-mfc: Let the upstream for PRERELEASE branches be main

Such branches are in code slush but are the same as stable branches for
the purpose of MFCs.
DeltaFile
+1-1tools/tools/git/git-mfc
+1-11 files

FreeBSD/src 4c1c2b9tools/tools/git git-mfc

git-mfc: Slightly relax the regex used to search for reverts

Prompted by commit 9dfaf1cb37f8ac89cf in FreeBSD src.

Reported by:    des
DeltaFile
+1-1tools/tools/git/git-mfc
+1-11 files

FreeBSD/src bb933b1sys/kern kern_event.c

kqueue: Allocate marker knotes on the stack

The scan marker was originally stack-allocated.  In commit
1c0f9af5b5224, it became heap-allocated since the marker is visible to
other threads and a scanning thread's stack may be swapped out.  Now
that kernel stacks can no longer be swapped out, we can avoid these heap
allocations.

Reviewed by:    kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58402
DeltaFile
+13-16sys/kern/kern_event.c
+13-161 files

FreeBSD/src 9a7bd33sys/kern sys_procdesc.c kern_exit.c, sys/sys procdesc.h

procdesc: Remove dead code

As far as I can see, it is impossible for procdesc_exit() to observe
pd->pd_fpcount == 0: if procdesc_close() decrements that counter to
zero, then it will clean up the procdesc structure too, and this is
atomic with respect to the proctree lock.

No functional change intended.

Reviewed by:    kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58396
DeltaFile
+4-18sys/kern/sys_procdesc.c
+2-1sys/kern/kern_exit.c
+1-1sys/sys/procdesc.h
+7-203 files

FreeBSD/src 586e2b3sys/kern uipc_usrreq.c, tests/sys/kern unix_passfd_test.c

unix: Preserve FD_RESOLVE_BENEATH when passing an fd

The FD_RESOLVE_BENEATH flag is supposed to be sticky.  It's set when you
receive an fd from a different jail and preserved by openat(<dfd>) etc..
However, if you send the fd to yourself, the flag is stripped since
SCM_RIGHTS message don't preserve file descriptor flags.

Fix this by preserving those flags and checking for UF_RESOLVE_BENEATH
in restrict_rights().

Fixes:          350ba9672a7f ("unix: Set O_RESOLVE_BENEATH on fds transferred between jails")
Reviewed by:    kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58317
DeltaFile
+31-0tests/sys/kern/unix_passfd_test.c
+19-8sys/kern/uipc_usrreq.c
+50-82 files

FreeBSD/src 91e11c8lib/libsys pdfork.2, sys/kern sys_procdesc.c

procdesc: Disallow pddupfd() of non-passable files

Reported by:    Maik Muench of Secfault Security
Reviewed by:    kib
Fixes:          1ad21a652182 ("kern: add pddupfd(2)")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58403
DeltaFile
+7-3sys/kern/sys_procdesc.c
+6-0lib/libsys/pdfork.2
+13-32 files

FreeBSD/src 76ca489sys/netinet6 nd6_rtr.c

netinet6/nd6: Sprinkle missing prefix refcounting

When we drop the prefix lock to call nd6_prefix_offlink() or
nd6_prefix_onlink(), make sure to keep the correpsonding prefix
structure alive.  It is possible for a concurrent nd6_timer() to expire
the prefix while the lock is dropped.

Reported by:    Maik Muench of Secfault Security
Reviewed by:    pouria, zlei
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58423
DeltaFile
+4-0sys/netinet6/nd6_rtr.c
+4-01 files

FreeBSD/src c7917e7sys/kern kern_kthread.c

kthread: Fix a thread leak

Fixes:          963629923308 ("kthread_add(): do not allow to attach the thread to a dead or dying process")
Reviewed by:    kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58433
DeltaFile
+1-0sys/kern/kern_kthread.c
+1-01 files

FreeBSD/src e591a76sys/compat/linuxkpi/common/include/net/page_pool helpers.h types.h, sys/compat/linuxkpi/common/src linuxkpi_page_pool.c

LinuxKPI: page pool updates and add to the build

Split implementation out from the header files.

This "page pool" is the very minimalistic version we need in order to
support packets on mt76.
We allocate the page pool in order to have the meta data available of
which we only make limited use.
This implementation does no pooling, it does no page fragments for now,
it always hands out a full page and frees it upon return.

It is written in a way that it can be in the tree before the 'struct page'
work it depends on has landed in order to reduce friction for people who
want to try mt7921 (or others later) upfront.  We use the same #ifdef
as in the struct page work for that reason so one knob will turn everything
on or off.

Once the struct page work has landed and settled we can start filling this
with more complexity.

    [8 lines not shown]
DeltaFile
+156-0sys/compat/linuxkpi/common/src/linuxkpi_page_pool.c
+30-28sys/compat/linuxkpi/common/include/net/page_pool/helpers.h
+18-1sys/compat/linuxkpi/common/include/net/page_pool/types.h
+2-0sys/conf/files
+1-0sys/modules/linuxkpi/Makefile
+207-295 files

FreeBSD/src 0b8d220sys/compat/linuxkpi/common/include/linux page.h

LinuxKPI: page.h: resort lines

Two of the "page macros" can be abstracted elsewhere in the upcoming
struct page work, so sort them away from the four which are here to
stay.

No functional change.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D58299
DeltaFile
+3-2sys/compat/linuxkpi/common/include/linux/page.h
+3-21 files

FreeBSD/src f45506csys/compat/linuxkpi/common/include/linux page.h

LinuxKPI: page.h: use atop() and ptoa() instead of PAGE_SHIFT

With upcoming changes to 'struct page' this will make the lines
easier to read by using the predefined macros from param.h.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    markj, kib
Differential Revision: https://reviews.freebsd.org/D58298
DeltaFile
+2-2sys/compat/linuxkpi/common/include/linux/page.h
+2-21 files

FreeBSD/src fe17840sys/compat/linuxkpi/common/include/linux scatterlist.h

LinuxKPI: sg_page() remove superfluous ()

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D58295
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/scatterlist.h
+1-11 files

FreeBSD/src ac4b43bsys/compat/linuxkpi/common/src linux_page.c

LinuxKPI: prefer struct page [*] over struct vm_page[_t]

LinuxKPI is based on Linux 'struct page' which is currently aliased
to struct vm_page.  Upcoming changes may change that so start using
'struct page *' instead vm_page_t to make future changes transparent.

This is a continuation of 9e9c682ff3a1 and should be a NOP.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D58297
DeltaFile
+2-2sys/compat/linuxkpi/common/src/linux_page.c
+2-21 files

FreeBSD/src 0845efesys/compat/linuxkpi/common/include/linux page.h

LinuxKPI: move clear_page() within the linux/page.h file

clear_page() would normally live in asm/page.h but adding the file
and fixing the dependencies would be too much for a single line.

Move the function to the end of the file with a clear separator
and make it clear that it does not operate on a 'struct page'
but on a page address by changing the argument name and leaving
a comment.

The function is currently used by at least mthca(4) as the only
in-tree consumer, and drm-kmod ttm_pool.c.

No functional changes.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D58296
DeltaFile
+7-1sys/compat/linuxkpi/common/include/linux/page.h
+7-11 files

FreeBSD/src 2099bf2sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: pci: fix dma handle type in match function

dma_addr_t is a vm_paddr_t which is a uint of some width.  Rather than
passing pointers of it around pass the value.

Comparing the addresses of different storage for the same dma handle
(the actual bug here) will not work when passed to the devres match
function.

Sponsored by:   The FreeBSD Foundation
Fixes:          0a575891211ef ("implement dmam_free_coherent()")
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D58285
DeltaFile
+4-4sys/compat/linuxkpi/common/src/linux_pci.c
+4-41 files

FreeBSD/src 8a7ab3esys/dev/usb/video uvideo.c

uvideo: Return actual mtx_sleep error in dqbuf

Don't coerce errors to EINVAL, which isn't correct for mtx_sleep's
failure cases.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/dev/usb/video/uvideo.c
+1-11 files

FreeBSD/src b22b159sys/dev/aq aq_hw.h aq_fw1x.c

aq(4): Use standard ETHER_ADDR_LEN definition

No need for a bespoke #define.

(cherry picked from commit 8c64625d90792462289686e0209a9f3fff67fc9b)
DeltaFile
+2-1sys/dev/aq/aq_hw.h
+1-1sys/dev/aq/aq_fw1x.c
+0-2sys/dev/aq/aq_common.h
+1-1sys/dev/aq/aq_fw2x.c
+4-54 files

FreeBSD/src daf364fsys/dev/aq aq_hw_llh.c aq_ring.c

aq(4): style(9) cleanup

(cherry picked from commit 668423f75b4d9006f16847b415c861defb8267d7)
DeltaFile
+62-34sys/dev/aq/aq_hw_llh.c
+11-7sys/dev/aq/aq_ring.c
+10-6sys/dev/aq/aq_fw.c
+10-5sys/dev/aq/aq_hw.c
+4-2sys/dev/aq/aq_dbg.c
+2-3sys/dev/aq/aq_fw1x.c
+99-575 files not shown
+106-6711 files

FreeBSD/src 06a2734sys/dev/aq aq_hw_llh.c aq_hw.c

aq(4): Style, whitespace and misc cleanup

The compiled objects do not change other than a few diagnostic messages
that include __LINE__.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54304

(cherry picked from commit 96156003ec0c70de88a448d48d8e9bd37913589f)
DeltaFile
+1,100-1,024sys/dev/aq/aq_hw_llh.c
+516-503sys/dev/aq/aq_hw.c
+453-420sys/dev/aq/aq_hw_llh.h
+299-271sys/dev/aq/aq_fw2x.c
+260-204sys/dev/aq/aq_main.c
+219-209sys/dev/aq/aq_fw.c
+2,847-2,63112 files not shown
+3,598-3,34118 files

FreeBSD/src df0b781sys/dev/aq aq_common.h aq_dbg.h

aq(4): Use sys, not userland, headers

And remove some unused definitions.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54152

(cherry picked from commit d2850435f18c81479f79bd23ea8d4b997dbc0521)
DeltaFile
+1-7sys/dev/aq/aq_common.h
+1-1sys/dev/aq/aq_dbg.h
+1-1sys/dev/aq/aq_fw.c
+1-1sys/dev/aq/aq_fw1x.c
+1-1sys/dev/aq/aq_fw2x.c
+0-1sys/dev/aq/aq_hw.h
+5-126 files

FreeBSD/src 56e056asys/dev/aq aq_hw_llh_internal.h aq_hw_llh.c

sys: Import snapshot of Aquantia ACQ107 vendor driver

Obtained from https://github.com/Aquantia/aqtion-freebsd commit
c61d27b1d94af72c642deefa0595884481ea7377.

This is not using a vendor branch.  The formerly-upstream repo is
abandoned and I do not believe it will receive updates.  This initial
import serves as a snapshot of the vendor code, but from here we will
iterate on it in the tree as our own code.

Bug fixes, code cleanup, and build infrastructure will follow.

NetBSD and OpenBSD have derivatives of this driver (with additional
hardware support).  We can look to changes in those drivers, and the
Linux driver, to add support here.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53813

    [2 lines not shown]
DeltaFile
+3,335-0sys/dev/aq/aq_hw_llh_internal.h
+1,986-0sys/dev/aq/aq_hw_llh.c
+1,329-0sys/dev/aq/aq_main.c
+1,176-0sys/dev/aq/aq_hw_llh.h
+907-0sys/dev/aq/aq_hw.c
+581-0sys/dev/aq/aq_ring.c
+9,314-012 files not shown
+12,109-018 files

FreeBSD/src c9ee056sys/dev/aq aq_main.c aq_media.c

aq(4): Port to IfAPI

Direct access to struct ifnet members is not possible in FreeBSD 15;
accessors must be used.  These exist in all supported FreeBSD versions,
so we do not need to make this conditional.

(cherry picked from commit 4756f5ff8f10cdda925cab60c0b66606698e49ee)
DeltaFile
+8-8sys/dev/aq/aq_main.c
+6-6sys/dev/aq/aq_media.c
+2-2sys/dev/aq/aq_ring.c
+16-163 files

FreeBSD/src 539bc9asys/dev/aq aq_main.c

aq(4): Remove unused DRIVER_MODULE devclass

(cherry picked from commit 2b587c0c8a933cd110ae579366644a280c509b7f)
DeltaFile
+4-0sys/dev/aq/aq_main.c
+4-01 files

FreeBSD/src f6e84c7sys/dev/aq aq_hw.c

aq(4): Remove #include of user header <unistd.h>

pause() has 2 different definition in unistd.h and sys/systm.h

(cherry picked from commit 14eb7ec7b7135ad1a3448590cbe70b1368b40ec7)
DeltaFile
+0-1sys/dev/aq/aq_hw.c
+0-11 files

FreeBSD/src 1fecb10sys/dev/aq aq_ring.c

aq(4): Fix VLAN tag test

Previously emitted a compiler warning "warning: bitwise comparison
always evaluates to false."

Looking at the OpenBSD driver (which is based on this code) it looks
like the VLAN flag should be set if either of these bits is.  In the
OpenBSD driver these are AQ_RXDESC_TYPE_VLAN and AQ_RXDESC_TYPE_VLAN2
rather than a magic number 0x60.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53836

(cherry picked from commit 8666fda1afb03b3a88e57a20d76da8e7910b6407)
DeltaFile
+1-1sys/dev/aq/aq_ring.c
+1-11 files

FreeBSD/src bd6af81sys/dev/aq aq_main.c

aq(4): Remove unimplemented functions

aq_if_priv_ioctl and aq_if_debug have prototypes but are not yet
implemented.  Just remove the commented-out DEVMETHODs and the unused
prototypes, to clear a build-time warning; the DEVMETHODs and prototypes
can be readded if / when they are implemented.

(cherry picked from commit 0156be41a1eb8e0408819466b912181aa7966df9)
DeltaFile
+0-4sys/dev/aq/aq_main.c
+0-41 files

FreeBSD/src cff985dusr.bin/vtfontcvt vtfontcvt.c

vtfontcvt: Avoid dead store in add_char

The fallback glyph is stored at index 0, and does not need to be
inserted into a mapping.

Previously there was a dead store of add_glyph's return value for the
fallback case, which upset Clang's static analyzer.  Now, cast the
return value to (void) to make it clear this is intentional.

Also change add_glyph's fallback parameter to a c99 bool to make its use
more clear.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57174

(cherry picked from commit b273481f2a840a05e4039655be99528e1fa9388c)
DeltaFile
+4-4usr.bin/vtfontcvt/vtfontcvt.c
+4-41 files

FreeBSD/src 8468152sys/dev/usb/video uvideo.c

uvideo: fix step=0 infinite loop and int overflow in fbuf_size

Prevent infinite loop in uvideo_vs_negotiation() when a USB camera reports
step=0 in its continuous frame interval descriptor.
Cast fbuf_size calculation to uint64_t to avoid int overflow for large
width/height/bpp combinations.

Reported by:    emaste
DeltaFile
+3-1sys/dev/usb/video/uvideo.c
+3-11 files

FreeBSD/src 26bb78blib/libsysdecode netlink.c

libsysdecode: add Netlink attribute decoding infrastructure

Introduce a generic Netlink attribute decoding framework based on
attribute decoder tables. The framework supports decoding primitive
attribute types as well as nested attributes and can be reused by
different Generic Netlink families.

Signed-off-by:  Ishan Agrawal <iagrawal9990 at gmail.com>
Sponsored-by:   Google LLC (GSoC 2026)
Reviewed-by:    kp
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2337
DeltaFile
+213-2lib/libsysdecode/netlink.c
+213-21 files