HardenedBSD/src 6914783share/man/man9 ucred.9, sys/fs/nfsserver nfs_nfsdport.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+16-9sys/kern/kern_prot.c
+17-2share/man/man9/ucred.9
+3-2sys/sys/ucred.h
+2-2sys/kern/vfs_export.c
+2-2sys/rpc/svc_auth.c
+1-1sys/fs/nfsserver/nfs_nfsdport.c
+41-186 files not shown
+47-2212 files

HardenedBSD/src 5735c3elib/libthr/thread thr_getthreadid_np.c, sys/kern kern_thread.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+1-1lib/libthr/thread/thr_getthreadid_np.c
+1-1sys/kern/kern_thread.c
+2-22 files

HardenedBSD/src f61c48fshare/man/man9 ucred.9, sys/fs/nfs nfs_commonport.c

kern: rename crsetgroups_fallback, document it in ucred(9)

As of FreeBSD 15.0, crsetgroups() *only* sets supplementary groups,
while crsetgroups_and_egid() will do both using an array of the same
style that previous versions used for crsetgroups() -- i.e., the first
element is the egid, and the remainder are supplementary groups.

Unlike the previous iteration of crsetgroups(), crsetgroups_and_egid()
is less prone to misuse as the caller must provide a default egid to use
in case the array is empty.  This is particularly useful for groups
being set from data provided by userland.

Reviewed by:    olce
Suggested by:   olce
Differential Revision:  https://reviews.freebsd.org/D51647
DeltaFile
+17-2share/man/man9/ucred.9
+5-5sys/kern/kern_prot.c
+2-2sys/kern/vfs_export.c
+2-2sys/rpc/svc_auth.c
+2-2sys/sys/ucred.h
+1-1sys/fs/nfs/nfs_commonport.c
+29-144 files not shown
+33-1810 files

HardenedBSD/src 09f2abasys/compat/linux linux_misc.c linux_uid16.c, sys/kern kern_prot.c

kern: add a new ucred flag for groups having been set

Now that we can legitimately have ngroups == 0 as a result of calling
crsetgroups(), set a flag when we've set groups for the sake of sanity
checking usage of crextend().  While it's true this flag will only
really be used under INVARIANTS, it's only the second flag bit that
we're adding in 16 years.

Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D51646
DeltaFile
+11-4sys/kern/kern_prot.c
+1-0sys/compat/linux/linux_misc.c
+1-0sys/compat/linux/linux_uid16.c
+1-0sys/sys/ucred.h
+14-44 files

HardenedBSD/src c0b4b2dlib/libthr/thread thr_getthreadid_np.c

libthr: fix typo in comment

(cherry picked from commit b87013fe70c051278e67d103d93c5292721cbcba)
DeltaFile
+1-1lib/libthr/thread/thr_getthreadid_np.c
+1-11 files

HardenedBSD/src 3a54914sys/kern kern_thread.c

kern/kern_thread.c: fix typo in comment

(cherry picked from commit a0041aee49bebd306179382658bcf965e6db5aef)
DeltaFile
+1-1sys/kern/kern_thread.c
+1-11 files

HardenedBSD/src bbcd375stand/libsa ip.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+4-2stand/libsa/ip.c
+4-21 files

HardenedBSD/src 733da23stand/libsa ip.c

libsa: errors with pointer conversion

loader ip implementation is using pointer to structure ip to receive
the packet and is using this pointer to cast on other data types
(namely structure arphdr). Problem does arise when those data structures
are declared with different alignment rules and when/if the compiler
does check those rules. To work around and silence warnings, use
void * generic pointer instead.

Error seen with gcc 14 (-Werror=address-of-packed-member).

Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D51662
DeltaFile
+4-2stand/libsa/ip.c
+4-21 files

HardenedBSD/src d733b7clib/libc/tests/db dbm_nextkey_test.c, sys/compat/linuxkpi/common/include/linux pci.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+44-39sys/dev/mmc/host/dwmmc.c
+34-26sys/compat/linuxkpi/common/include/linux/pci.h
+53-0lib/libc/tests/db/dbm_nextkey_test.c
+28-5sys/kern/vfs_aio.c
+15-9sys/compat/linuxkpi/common/src/linux_acpi.c
+10-10sys/compat/linuxkpi/common/src/linux_pci.c
+184-896 files not shown
+193-9612 files

HardenedBSD/src 0a3792drelease/tools vmimage.subr

release: No newaliases when cross-building VMs

We've been running newaliases(8) when cross-building VMs for a long
time, and it's not entirely clear why -- especially since we don't
do it when we're building a native VM image.

If someone knows why running newaliases is important we can add it
back later, but only after newaliases gets unbroken: As of last week
(a3d4ae7cf351) newaliases fails with EPERM on /etc/dma/dma.conf.

This should unbreak VM (and cloudware) cross-builds.

With hat:       re@
DeltaFile
+0-1release/tools/vmimage.subr
+0-11 files

HardenedBSD/src 421bf3asys/compat/linuxkpi/common/include/linux pci.h, sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: pci: fix argument type to linuxkpi_pci_iomap[_range]

The last argument (maxlen) to linuxkpi_pci_iomap_range and
linuxkpi_pci_iomap is an unsigned long not an int.  LinuxKPI is
not using that argument in the end but fix it where needed.
While here adjust the name to 'maxlen' and remove the "mmio_" to
bar and off.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D51651
DeltaFile
+9-9sys/compat/linuxkpi/common/src/linux_pci.c
+4-4sys/compat/linuxkpi/common/include/linux/pci.h
+13-132 files

HardenedBSD/src 0f8a841sys/dev/mmc/host dwmmc.c

dwmmc: cleanup cmd and locking, consistency between mmc and mmccam

In general sprinkle locking assertions and harmonized KASSERTs
throughout the upper part of the driver to document expectations.

In dwmmc_cmd_done() "cmd" should be set correctly and be used for
both MMCCAM and classic mmc rather than special-casing mmccam.
In dwmmc_next_operation() place variable declarations on the top
for both cases before the first debug and lock assertion calls;
then factor out common parts at the end and put both cases in the
same order.
By calling dwmmc_next_operation() directly from both dwmmc_request()
in the mmc case, and dwmmc_cam_request() in the mmccase (rather than)
chaining calls in the latter, we avoid unlocking the sc in the mmccam
case and have a consistent call path from both; also removing the
mmccam #ifdef from dwmmc_request() brings more clarity.
In dwmmc_next_operation() enhance the panic/error messages with
some extra information and assert that we come in with a cam pinfo
on CAM_ACTIVE_INDEX.

    [4 lines not shown]
DeltaFile
+44-39sys/dev/mmc/host/dwmmc.c
+44-391 files

HardenedBSD/src 69ffe3ausr.sbin/bsnmpd/modules/snmp_wlan wlan_sys.c

bsnmp: wlan: use correct value for rssi

net80211 keeps the rssi value in 0.5bm relative to the noise floor
(see comment in ieee80211_node.h).  Do proper maths to get a plain
rssi value back (once further fixes are in net80211).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D50930
DeltaFile
+1-1usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c
+1-11 files

HardenedBSD/src a964865sys/compat/linuxkpi/common/include/linux pci.h, sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: pci: use unsigned int for vendor/device arguments

Linux drivers may pass a typed PCI_ANY_ID (-1U) in which then leads
to a warning that the value gets truncated.  Switch argument types
to unsigned int (or uint32_t as we use in struct pci_device_id) to
avoid the problem.

Sponsored by:   The FreeBSD Foundation
Discussed in:   D50008
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D51652
DeltaFile
+2-2sys/compat/linuxkpi/common/include/linux/pci.h
+1-1sys/compat/linuxkpi/common/src/linux_pci.c
+3-32 files

HardenedBSD/src 69ed0f7sys/compat/linuxkpi/common/include/linux pci.h

LinuxKPI: pci: harmonize #defines

In some blocks of #defines spacing, trailing \ and indentation of a
second line differed.  Some of them are currently fine on a single
line but future additions may not fit in that scheme.
Harmonize them into a #define X\t\t\t...\\n<4 spaces>Y scheme.

No functional changes.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D51650
DeltaFile
+28-20sys/compat/linuxkpi/common/include/linux/pci.h
+28-201 files

HardenedBSD/src 21cb44bsys/compat/linuxkpi/common/include/acpi acpi_bus.h, sys/compat/linuxkpi/common/src linux_acpi.c

LinuxKPI: acpi: fix guid_t argument type

acpi_check_dsm() and acpi_evaluate_dsm_typed() take a guid_t argument
and not a char *.  For in-tree Linux based drivers this leads to a
compile error due to a warning.  Fix the function argument type and
cast internally.

While this made the long statements in the wrapper functions for *_dsm_*
even less readable split them up using a local variable.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D51649
DeltaFile
+15-9sys/compat/linuxkpi/common/src/linux_acpi.c
+2-2sys/compat/linuxkpi/common/include/acpi/acpi_bus.h
+17-112 files

HardenedBSD/src 2dde3besys/kern vfs_aio.c

aio: Fix a race in sys_aio_cancel()

sys_aio_cancel() loops over pending jobs for the process, cancelling
some of them.  To cancel a job with a cancel callback, it must drop the
job list mutex.  It uses flags, KAIOCB_CANCELLING and KAIOCB_CANCELLED,
to make sure that a job isn't double-cancelled.  However, when iterating
over the list it uses TAILQ_FOREACH_SAFE and thus assumes that the next
job isn't going to be removed while the lock is dropped.  Of course,
this assumption is false.

We could simply start search from the beginning after cancelling a job,
but that might be quite expensive.  Instead, introduce the notion of a
marker job, used to keep track of one's position in the queue.  Use it
in sys_aio_cancel() to resume iteration after a job is cancelled.

Reported by:    syzkaller
Reviewed by:    kib, jhb
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D51626
DeltaFile
+28-5sys/kern/vfs_aio.c
+28-51 files

HardenedBSD/src 3a686b8lib/libc/db/hash hash.c, lib/libc/tests/db dbm_nextkey_test.c Makefile

dbm_nextkey: Always return an error if we've reached the end of the database

POSIX.1 states that `dbm_nextkey` must return an invalid key
(i.e., `key.dptr == NULL`) after the end of the database was reached.
The current implementation of `hash_seq` will incorrectly restart
the key sequence after the end of the database is reached.

Fix this by checking the "current bucket" index when R_NEXT is passed.

Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D51635
Reviewed by:    markj
DeltaFile
+53-0lib/libc/tests/db/dbm_nextkey_test.c
+4-2lib/libc/db/hash/hash.c
+1-0lib/libc/tests/db/Makefile
+58-23 files

HardenedBSD/src ada5bbashare/misc organization.dot

organization.dot: update list of current portmgr members
DeltaFile
+1-1share/misc/organization.dot
+1-11 files

HardenedBSD/src 2266c60sys/netinet tcp_hpts.h tcp_hpts.c

tcp hpts: cleanup header file

Cleanup tcp_hpts.h by
* move definition used only in tcp_hpts.c to that file
* fix a typo
* remove duplicate declarion of tcp_min_hptsi_time
* rearange declarations for simpler reading

Approved by:    tuexen
MFC after:      1 week
Sponsored by:   Netflix, Inc.
DeltaFile
+36-80sys/netinet/tcp_hpts.h
+45-2sys/netinet/tcp_hpts.c
+81-822 files

HardenedBSD/src f197a24sys/netinet tcp_hpts.c tcp_hpts.h, sys/netinet/tcp_stacks rack.c bbr.c

tcp: improve variable and constant names

Don't use ticks in variable names or constant when they don't have
a relation to ticks. Use slots or usecs.
No functional change intended.

Reviewed by:    tuexen
MFC after:      1 week
Sponsored by:   Netflix, Inc.
DeltaFile
+16-16sys/netinet/tcp_hpts.c
+13-13sys/netinet/tcp_stacks/rack.c
+10-10sys/netinet/tcp_hpts.h
+3-3sys/netinet/tcp_stacks/bbr.c
+42-424 files

HardenedBSD/src dc0c742sys/netinet tcp_hpts.h tcp_hpts.c, sys/netinet/tcp_stacks rack.c bbr.c

tcp: improve function names

tcp_tv_to_usectick(), tcp_tv_to_mssectick(), and tcp_tv_to_lusectick()
are not related to ticks. Therefore remove the trailing 'tick'.
No functional change intended.

Reviewed by:    tuexen
MFC after:      1 week
Sponsored by:   Netflix, Inc.
DeltaFile
+40-40sys/netinet/tcp_stacks/rack.c
+22-22sys/netinet/tcp_stacks/bbr.c
+5-5sys/netinet/tcp_hpts.h
+4-4sys/netinet/tcp_hpts.c
+3-3sys/netinet/tcp_stacks/rack_pcm.c
+1-1sys/netinet/tcp_lro_hpts.c
+75-756 files

HardenedBSD/src c6236b3share/man/man9 style.9, sys/netinet tcp_hpts.h tcp_hpts.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+42-86sys/netinet/tcp_hpts.h
+53-53sys/netinet/tcp_stacks/rack.c
+65-22sys/netinet/tcp_hpts.c
+25-25sys/netinet/tcp_stacks/bbr.c
+3-3sys/netinet/tcp_stacks/rack_pcm.c
+2-2share/man/man9/style.9
+190-1912 files not shown
+192-1928 files

HardenedBSD/src 28ad9f2usr.bin/clang/clang-scan-deps Makefile

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+4-3usr.bin/clang/clang-scan-deps/Makefile
+4-31 files

HardenedBSD/src 868b549share/man/man9 style.9

style.9: Fix "parantheses" typos in the new C++ section

PR:             288564
Fixes:          4b02ad9d5063 ("style.9: Add a C++ section")
Sponsored by:   The FreeBSD Foundation (commit)
DeltaFile
+2-2share/man/man9/style.9
+2-21 files

HardenedBSD/src a8d90e3sys/netlink netlink_io.c

netlink: Fully clear parser state between messages

Failing to reset the cookie between messages can lead to an attempt
to interpret a zeroed buffer as a struct nlattr, causing a length
calculation to underflow, resulting in a memcpy() call where the
length exceeds the actual size of the buffer.

MFC after:      1 week
PR:             283797
Reviewed by:    glebius
Differential Revision:  https://reviews.freebsd.org/D51634
DeltaFile
+1-0sys/netlink/netlink_io.c
+1-01 files

HardenedBSD/src 30218ebusr.bin/clang/clang-scan-deps Makefile

clang-scan-deps: Pass ${TDFILE} to tblgen, not ${.ALLSRC}

${.ALLSRC} can include the dependency OptParser.td, which causes
llvm-tblgen to fail since it only accepts a single input argument.

Use ${TDFILE} directly instead, which matches the other invocations
of tblgen in the LLVM Makefiles.

Fixes:          d3c06bed2c16 ("clang: install clang-scan-deps")
MFC after:      3 days
Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D51569

(cherry picked from commit ad023bc26e106e28e1b4845f991b52b533bd0802)
DeltaFile
+4-3usr.bin/clang/clang-scan-deps/Makefile
+4-31 files

HardenedBSD/src fb3044fsbin/swapon/tests swapon_test.sh, sys/compat/linux linux_misc.c linux_uid16.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+113-86sys/kern/kern_prot.c
+52-8sbin/swapon/tests/swapon_test.sh
+7-28sys/compat/linux/linux_misc.c
+6-28sys/compat/linux/linux_uid16.c
+16-10sys/sys/ucred.h
+4-16sys/ufs/ufs/ufs_vnops.c
+198-17613 files not shown
+222-19919 files

HardenedBSD/src 61c2dfcsys/dev/qlnx/qlnxe qlnx_os.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+2-3sys/dev/qlnx/qlnxe/qlnx_os.c
+2-31 files

HardenedBSD/src 4befc67sys/sys param.h

param.h: bump __FreeBSD_version for be1f7435ef218b

I meant to review the diff again to make sure that __FreeBSD_version had
not progressed in the interim, but failed to do so- belatedly bump it
for a struct ucred ABI change.

Fixes:  be1f7435ef21 ("kern: start tracking cr_gid outside of [...]")
DeltaFile
+1-1sys/sys/param.h
+1-11 files