FreeBSD/src 7b95d2a. Makefile.inc1

pkgbase: Fix OSVERSION specification when creating a repo

-o OSVERSION= needs to appear before the "repo" verb, otherwise it has
no effect.  In this case, recent pkg-devel fails to create the repo,
saying that ABI cannot be specified without OSVERSION.

Reviewed by:    kevans, manu
MFC after:      2 weeks
Fixes:          188fe88ec50e ("pkgbase: force OSVERSION")
Differential Revision:  https://reviews.freebsd.org/D48518

(cherry picked from commit f9097705fb1c8d9c1f8946d1c1897d606bdbd517)
DeltaFile
+1-2Makefile.inc1
+1-21 files

FreeBSD/src 67e54a0sys/vm vm_pageout.c vm_pagequeue.h

vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning

Right now we have the vm.pageout_cpus_per_thread tunable which controls
the number of threads to start up per CPU per NUMA domain, but after
booting, it's not possible to disable multi-threaded scanning.

There is at least one workload where this mechanism doesn't work well;
let's make it possible to disable it without a reboot, to simplify
troubleshooting.

Reviewed by:    dougm, kib
MFC after:      2 weeks
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum MDPay
Differential Revision:  https://reviews.freebsd.org/D48377

(cherry picked from commit 55b343f4f9bc586eba5e26a2524a35f04dd60c65)
DeltaFile
+7-2sys/vm/vm_pageout.c
+3-2sys/vm/vm_pagequeue.h
+1-0sys/vm/vm_page.c
+11-43 files

FreeBSD/src e8e2e21. Makefile.inc1

pkgbase: Fix OSVERSION specification when creating a repo

-o OSVERSION= needs to appear before the "repo" verb, otherwise it has
no effect.  In this case, recent pkg-devel fails to create the repo,
saying that ABI cannot be specified without OSVERSION.

Reviewed by:    kevans, manu
MFC after:      2 weeks
Fixes:          188fe88ec50e ("pkgbase: force OSVERSION")
Differential Revision:  https://reviews.freebsd.org/D48518

(cherry picked from commit f9097705fb1c8d9c1f8946d1c1897d606bdbd517)
DeltaFile
+1-1Makefile.inc1
+1-11 files

FreeBSD/src 49f7412sys/netinet in_pcb.c, sys/netinet6 in6_pcb.c

inpcb: Further restrict binding to a port owned by a different UID

See commit 4f02a7d739b3 for more background.

I cannot see a good reason to continue ignoring mismatching UIDs when
binding to INADDR_ANY.  Looking at the sdr.V2.4a7n sources (mentioned in
bugzilla PR 7713), there is a CANT_MCAST_BIND hack wherein the
application binds to INADDR_ANY instead of a multicast address, but
CANT_MCAST_BIND isn't defined for FreeBSD builds.

It seems unlikely that we still have a use-case for allowing sockets
from different UIDs to bind to the same port when binding to the
unspecified address.  And, as noted in D47832, applications like sdr
would have been broken by the inverted SO_REUSEPORT check removed in
that revision, apparently without any bug reports.  Let's break
compatibility and simply disallow this case outright.

Also, add some comments, remove a hack in a regression test which tests
this funtionality, and add a new regression test to exercise the

    [8 lines not shown]
DeltaFile
+76-10tests/sys/netinet/socket_afinet.c
+9-2sys/netinet6/in6_pcb.c
+9-2sys/netinet/in_pcb.c
+94-143 files

FreeBSD/src 697c156sys/netpfil/pf pf.c, tests/sys/netpfil/pf nat64.sh

pf: fix IPv6 route lookup for nat64

The route lookup in pf_route6() (for the nat64 case) had the src/dst for bcopy()
swapped around, so any nat64 setup that passed via a gateway on the IPv6 side
was broken.

Fix this, add 'const' to make this error actually fail to compile and add a
test case.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+63-0tests/sys/netpfil/pf/nat64.sh
+3-3sys/netpfil/pf/pf.c
+66-32 files

FreeBSD/src e02b579tests/sys/sound pcm_read_write.c

sound tests: Fix 32bit calculation detection in pcm_read_write

Fix a mistake in the pcm_read_write test that would result in not
properly detecting 32bit calculation on 32bit architectures like i386.
As a consequence, the wrong values would be checked, thus failing the
test.

Reported by:    CI
Fixes:          27ef5d48c729 ("sound: Unit test the pcm sample read and write macros")
MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D48617
DeltaFile
+9-3tests/sys/sound/pcm_read_write.c
+9-31 files

FreeBSD/src 69e2004sys/kern kern_sysctl.c

kern_sysctl: Make name2oid() non-destructive to the name

It is not the first time I see it panicking while trying to modify
const memory.  Lets make it safer and easier to use.  While there,
mark few functions using it also const.

MFC after:      10 days

(cherry picked from commit f80babf906b7be51b2a031ef26525893c7bf4e31)
(cherry picked from commit 1a1a1728e0bec6e5b978e6c5c7433ca91596b389)
DeltaFile
+25-4sys/kern/kern_sysctl.c
+25-41 files

FreeBSD/src c44335bsys/kern kern_sysctl.c

name2oid: use find_oidname

In name2oid, use sysctl _find_oidname instead of re-implementing it.
Reviewed by:    hselasky
Differential Revision:  https://reviews.freebsd.org/D36765

(cherry picked from commit 9f6f9007b98fc407a1b064c4492697e27954191a)
DeltaFile
+1-7sys/kern/kern_sysctl.c
+1-71 files

FreeBSD/src 1a1a172sys/kern kern_sysctl.c

kern_sysctl: Make name2oid() non-destructive to the name

It is not the first time I see it panicking while trying to modify
const memory.  Lets make it safer and easier to use.  While there,
mark few functions using it also const.

MFC after:      10 days

(cherry picked from commit f80babf906b7be51b2a031ef26525893c7bf4e31)
DeltaFile
+25-4sys/kern/kern_sysctl.c
+25-41 files

FreeBSD/src 09cbd68sbin/sysctl sysctl.c sysctl.8

sysctl: Add flags to filter jail prison and vnet variables

So users do not have to contact the source code to tell whether a
variable is a jail prison / vnet one or not.

Reviewed by:    cy (previous version), markj, jamie (for #jails)
MFC after:      2 weeks
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D47107

(cherry picked from commit 5ec83c660acaf30c1d6b9417dbd8c80dfa9d56ac)
DeltaFile
+16-1sbin/sysctl/sysctl.c
+7-2sbin/sysctl/sysctl.8
+23-32 files

FreeBSD/src f10a065libexec/rtld-elf/amd64 reloc.c, libexec/rtld-elf/i386 reloc.c

rtld-elf/{amd64,i386}/reloc.c: remove unneeded #ifdef dbg

(cherry picked from commit e3035c52f25356299abc8e08be9221032967554d)
DeltaFile
+0-2libexec/rtld-elf/i386/reloc.c
+0-2libexec/rtld-elf/amd64/reloc.c
+0-42 files

FreeBSD/src 86e95bbsys/compat/freebsd32 freebsd32.h freebsd32_misc.c, sys/fs/tmpfs tmpfs_vnops.c

stat(2): add st_filerev

(cherry picked from commit b4663a8d111767206bb3ebcfec5b95a6b88bc720)
DeltaFile
+2-1sys/compat/freebsd32/freebsd32.h
+2-1sys/sys/stat.h
+2-0sys/kern/vfs_default.c
+2-0sys/ufs/ufs/ufs_vnops.c
+1-0sys/compat/freebsd32/freebsd32_misc.c
+1-0sys/fs/tmpfs/tmpfs_vnops.c
+10-23 files not shown
+13-29 files

FreeBSD/src 5782050libexec/rtld-elf rtld.c

rtld-elf/rtld.c: fix typo in comment

(cherry picked from commit dd1d72961b8d343b29480b74afcfe4292fd166af)
DeltaFile
+1-1libexec/rtld-elf/rtld.c
+1-11 files

FreeBSD/src c294ecbsbin/sysctl sysctl.c sysctl.8

sysctl: Sort options

No functional change intended.

MFC after:      1 day
DeltaFile
+13-13sbin/sysctl/sysctl.c
+8-8sbin/sysctl/sysctl.8
+21-212 files

FreeBSD/src 0ee3e29sbin/sysctl sysctl.8 sysctl.c

sysctl: Fix usage() and SYNOPSIS section of man page

I forgot to update the usage() and SYNOPSIS section of man page when
adding the two options -J and -V.

While here, fix the options sort order in SYNOPSIS section.

Fixes:  5ec83c660aca sysctl: Add flags to filter jail prison and vnet variables
MFC after:      1 day
DeltaFile
+3-3sbin/sysctl/sysctl.8
+2-2sbin/sysctl/sysctl.c
+5-52 files

FreeBSD/src bb14579sys/ufs/ffs ffs_suspend.c

Eliminate unneeded variables and computations.

No functional change.

(cherry picked from commit df48361e7792f9a9e6371f95c1228d4af2808d2a)
DeltaFile
+2-5sys/ufs/ffs/ffs_suspend.c
+2-51 files

FreeBSD/src 26c483asys/ufs/ffs ffs_vfsops.c ffs_subr.c

Fix backward compatibility with UFS1 filesystems created before June 2002

Reviewed-by: kib
Tested-by:   Peter Holm
Differential-Revision: https://reviews.freebsd.org/D48472
(cherry picked from commit 661ca921e8cd56b17fc6615bc7e596e56e0e7c31)
DeltaFile
+1-95sys/ufs/ffs/ffs_vfsops.c
+80-1sys/ufs/ffs/ffs_subr.c
+3-2sys/ufs/ffs/fs.h
+2-2sys/ufs/ffs/ffs_softdep.c
+1-1sys/ufs/ffs/ffs_snapshot.c
+1-1sys/ufs/ffs/ffs_extern.h
+88-1021 files not shown
+88-1047 files

FreeBSD/src f31c37fsys/ufs/ffs ffs_vfsops.c

Use ffs_sbget() to replace open-coded superblock reload.

No functional change intended.

Tested-by: Peter Holm
(cherry picked from commit c18a6c15f4152029b6d1d0f64aa1ff36faceb9b2)
DeltaFile
+22-65sys/ufs/ffs/ffs_vfsops.c
+22-651 files

FreeBSD/src 996fe40sys/ufs/ffs ffs_suspend.c

Eliminate unneeded variables and computations.

No functional change.

(cherry picked from commit df48361e7792f9a9e6371f95c1228d4af2808d2a)
DeltaFile
+2-5sys/ufs/ffs/ffs_suspend.c
+2-51 files

FreeBSD/src f486ebblib/libsecureboot README.rst

libsecureboot/README.rst clarify use of gpg

Clarify some language and provide an example of gpg use to generate
a detached signature.
DeltaFile
+13-4lib/libsecureboot/README.rst
+13-41 files

FreeBSD/src 5f9a2eesys/dev/rtwn/rtl8192e r92e_rf.c

rtwn: bring the RTL8192EU RF read/write routines in line with rtl8xxxu

The Linux rtl8xxxu driver has more delays in the RF read and write
path.

It looks like for writes it's ensuring the hardware is out of
power save and that the transition has properly occured.

And it looks for reads that it wants a delay after some bit setting,
likely some shifting into the RF register space is occuring with
a bit set/clear to trigger a load.

See rtl8xxxu_write_rfreg() and rtl8xxxu_read_rfreg() for more
information.

Differential Revision:  https://reviews.freebsd.org/D48512
Obtained from:  Linux rtl8xxxu
DeltaFile
+3-0sys/dev/rtwn/rtl8192e/r92e_rf.c
+3-01 files

FreeBSD/src 40fc36fsys/dev/rtwn/rtl8192e r92e_init.c

rtwn: fix RTL8192EU power-down / power-up hanging

The RTL8192EU NIC (on older USB 2/USB 3 ports, not on newer
USB 3 ports, that still needs to be fixed!) will attach, scan,
associate fine.  However, restarting wpa_supplicant results in the
NIC hanging until you disconnect it.

It turns out early in the power_on sequence - BUT only after a
power_off - the NIC would suddenly stop responding to any USB
transfers.  It doesn't require the MCU to be available for USB
transfers - the hardware itself does that - so something had to be
going very sideways.

I traced it down to these steps during the power_off sequence.
They don't exist in the Linux rtl8xxxu driver, and there are commits
earlier in their RTL8192EU bring-up that suggest the author was
facing similar power sequencing / re-sequencing issues.

This likely won't fix the actual channel programming /

    [6 lines not shown]
DeltaFile
+4-0sys/dev/rtwn/rtl8192e/r92e_init.c
+4-01 files

FreeBSD/src 043d6a2sys/dev/rtwn/rtl8192e r92e_chan.c

rtwn: add workaround sleep in r92e_set_chan()

It /looks/ like there's some weirdness in initial frame send after
the chip programming / channel change.  Linux rtl8xxxu has no sleeps
here, instead it just retries the auth frame a few times.

My guess is there's some sequencing going on here between finishing
the programming, doing a calibration run and then sending the initial
frame.

Instead of doing sleeps on every write during the RF channel change,
this 10ms sleep at the end is enough to reliably associate in my
test environment (12-core intel laptop, USB-3 port.)  It's not
required for an earlier 2-core haswell laptop w/ USB-3.

See the PR for more information.

PR:             kern/247528
Differential Revision:  https://reviews.freebsd.org/D48517
DeltaFile
+24-0sys/dev/rtwn/rtl8192e/r92e_chan.c
+24-01 files

FreeBSD/src 4cdfa4eusr.sbin/fwget fwget.sh

fwget: Simplify logic

Summary:
Use log() to print messages that should be supressed when -q is in use.

No functional changes intended.

Differential Revision:  https://reviews.freebsd.org/D48393
Reviewed By:    manu
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit fb98fc4755def2cb8ca145751b0e54485d5e2f4a)
DeltaFile
+2-6usr.sbin/fwget/fwget.sh
+2-61 files

FreeBSD/src e6061e5usr.sbin/fwget fwget.sh

fwget: Silence log() when -q is used

Summary:
Silence log function when -q parameter is used to prevent undesired output

PR:             283939
Reviewed By:    manu
Differential Revision:  https://reviews.freebsd.org/D48391
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 19a6bc9f51e5c5705a2b396b0da61e6536acb4cb)
DeltaFile
+3-1usr.sbin/fwget/fwget.sh
+3-11 files

FreeBSD/src 1e734f1sys/modules/dtrace Makefile

dtrace: Build systrace_freebsd32 only if COMPAT_FREEBSD32 is configured

MFC after:      1 week
Sponsored by:   Innovate UK
DeltaFile
+2-0sys/modules/dtrace/Makefile
+2-01 files

FreeBSD/src 237e9b7usr.sbin/ctld uclparse.c ctld.c

ctld: Trim trailing whitespace

Sponsored by:   Chelsio Communications
DeltaFile
+6-6usr.sbin/ctld/uclparse.c
+3-3usr.sbin/ctld/ctld.c
+1-1usr.sbin/ctld/parse.y
+10-103 files

FreeBSD/src 2a44cccshare/man/man5 src.conf.5, share/mk bsd.lib.mk bsd.prog.mk

Add option to clear caller-used registers on function return.

The WITH_ZEROREGS option for src.conf will zero caller-used register
contents just before returning from a function, ensuring that
temporary values are not leaked beyond the function boundary. This
means that register contents are less likely to be available for side
channel attacks and information exposures.

It reduces all except 1 of the simple "write-what-where" ROP gadgets in
/lib:
    grep "Gadget found" /tmp/before_lib* | wc -l
     197
    grep "Gadget found" /tmp/after_lib* | wc -l
       1
    grep "Gadget found" /tmp/after_lib*
    /tmp/after_libbsdxml.so.4.txt:  [+] Gadget found: 0x1b3f1 mov qword ptr [rdi], rcx ; pop rbp ; ret

To reproduce:
    for lib in *.so.*; do

    [161 lines not shown]
DeltaFile
+9-0share/mk/bsd.lib.mk
+9-0share/mk/bsd.prog.mk
+6-1share/man/man5/src.conf.5
+6-0share/mk/bsd.compiler.mk
+4-0tools/build/options/WITH_ZEROREGS
+2-1share/mk/bsd.opts.mk
+36-22 files not shown
+39-28 files

FreeBSD/src 9dcb984usr.bin/chkey chkey.c, usr.bin/newkey update.c newkey.c

Remove publickey(5) stuff

This uses DES and it's likely that nobody uses that in 2025.
If somebody uses this we help them by deprecating and removing this.

Reviewed by:    bapt, emaste
Differential Revision:  https://reviews.freebsd.org/D30683
DeltaFile
+0-753usr.sbin/keyserv/keyserv.c
+0-497usr.sbin/keyserv/setkey.c
+0-332usr.bin/newkey/update.c
+0-267usr.bin/chkey/chkey.c
+0-265usr.sbin/keyserv/crypt_server.c
+0-228usr.bin/newkey/newkey.c
+0-2,34225 files not shown
+13-3,10531 files

FreeBSD/src 723425fusr.bin/chkey chkey.1, usr.bin/keylogin keylogin.1

Deprecate publickey(5) stuff

This uses DES and it's likely that nobody uses that in 2025.
If somebody uses this we help them by deprecating and removing this.

Reviewed by:    bapt, emaste
Differential Revision:  https://reviews.freebsd.org/D30682
DeltaFile
+5-0usr.bin/keylogin/keylogin.1
+5-0usr.bin/chkey/chkey.1
+5-0usr.bin/keylogout/keylogout.1
+5-0usr.bin/newkey/newkey.8
+5-0usr.sbin/keyserv/keyserv.8
+1-0usr.bin/keylogout/keylogout.c
+26-04 files not shown
+30-010 files