HardenedBSD/src c9c46a0lib/librt mq_getfd_np.3, share/man/man4 aq.4

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+0-133sys/kern/kern_racct.c
+12-115sys/net/if.c
+54-44sys/netinet/in.c
+57-0lib/librt/mq_getfd_np.3
+56-0share/man/man4/aq.4
+14-35sys/netinet6/in6.c
+193-32741 files not shown
+351-44547 files

HardenedBSD/src a3d8a42lib/librt mq_getfd_np.3, share/man/man4 aq.4

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+0-133sys/kern/kern_racct.c
+12-115sys/net/if.c
+54-44sys/netinet/in.c
+57-0lib/librt/mq_getfd_np.3
+56-0share/man/man4/aq.4
+14-35sys/netinet6/in6.c
+193-32741 files not shown
+351-44547 files

HardenedBSD/src c580e1bshare/man/man4 pcic.4 pccard.4, share/man/man9 bus_alloc_resource.9

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+210-219tests/sys/file/closefrom_test.c
+0-100share/man/man4/pcic.4
+0-78share/man/man4/pccard.4
+42-0sys/sys/bus.h
+7-22share/man/man9/bus_alloc_resource.9
+8-1stand/man/loader.efi.8
+267-42018 files not shown
+288-44924 files

HardenedBSD/src 6fd78a7share/man/man9 bus_alloc_resource.9, stand/man loader.efi.8

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+229-249tests/sys/file/closefrom_test.c
+34-43usr.sbin/ctld/nvmf.cc
+42-0sys/sys/bus.h
+7-17share/man/man9/bus_alloc_resource.9
+6-10usr.sbin/ctld/nvmf.hh
+8-1stand/man/loader.efi.8
+326-32012 files not shown
+345-33418 files

HardenedBSD/src 5ece89csys/netpfil/ipfilter/netinet ip_fil_freebsd.c

ipfilter: Add missing kenv fetch

When a module the environment must be explicitly fetched.

Fixes:                  d9788eabffa4
PR:                     291548
Noted by:               markj
Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D54242

(cherry picked from commit a6ea80bc917510b5e056cc5a29b62dfd7b39d068)
DeltaFile
+2-0sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+2-01 files

HardenedBSD/src 1b96cdesys/netpfil/ipfilter/netinet ip_fil_freebsd.c

ipfilter: Add missing kenv fetch

When a module the environment must be explicitly fetched.

Fixes:                  d9788eabffa4
PR:                     291548
Noted by:               markj
Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D54242
MFC after:              3 days
(cherry picked from commit a6ea80bc917510b5e056cc5a29b62dfd7b39d068)
DeltaFile
+2-0sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+2-01 files

HardenedBSD/src 8c64625sys/dev/aq aq_hw.h aq_common.h

aq(4): Use standard ETHER_ADDR_LEN definition

No need for a bespoke #define.
DeltaFile
+2-1sys/dev/aq/aq_hw.h
+0-2sys/dev/aq/aq_common.h
+1-1sys/dev/aq/aq_fw1x.c
+1-1sys/dev/aq/aq_fw2x.c
+4-54 files

HardenedBSD/src c53d90cstand/man loader.efi.8

loader.efi.8: Minor formatting nits

- Add several missing .Pp after lists and literal blocks.

- Fix the column widths for the console table and use a shorter indent
  so that it doesn't wrap on an 80-col display.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D53866

(cherry picked from commit 46d05a49a1d0d655af6cae2afd48a973698cbf71)
DeltaFile
+8-1stand/man/loader.efi.8
+8-11 files

HardenedBSD/src 400e081stand/man loader.efi.8

loader.efi.8: Minor formatting nits

- Add several missing .Pp after lists and literal blocks.

- Fix the column widths for the console table and use a shorter indent
  so that it doesn't wrap on an 80-col display.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D53866

(cherry picked from commit 46d05a49a1d0d655af6cae2afd48a973698cbf71)
DeltaFile
+8-1stand/man/loader.efi.8
+8-11 files

HardenedBSD/src bed9eb6sys/arm64/arm64 machdep_boot.c

arm64: Fix calculating kernel size for preload metadata

Cast &end to vm_offset_t before subtracting VM_MIN_KERNEL_ADDRESS to
ensure the resulting size is correct for PRELOAD_PUSH_VALUE.
Previously the correct size was effectively divided by sizeof(void *).

Reviewed by:    andrew
Obtained from:  CheriBSD
Differential Revision:  https://reviews.freebsd.org/D53699

(cherry picked from commit 587490dabc649b58f0c7966e749aa80a0f16796b)
DeltaFile
+2-1sys/arm64/arm64/machdep_boot.c
+2-11 files

HardenedBSD/src 37e9b42sys/arm64/arm64 machdep_boot.c

arm64: Fix calculating kernel size for preload metadata

Cast &end to vm_offset_t before subtracting VM_MIN_KERNEL_ADDRESS to
ensure the resulting size is correct for PRELOAD_PUSH_VALUE.
Previously the correct size was effectively divided by sizeof(void *).

Reviewed by:    andrew
Obtained from:  CheriBSD
Differential Revision:  https://reviews.freebsd.org/D53699

(cherry picked from commit 587490dabc649b58f0c7966e749aa80a0f16796b)
DeltaFile
+2-1sys/arm64/arm64/machdep_boot.c
+2-11 files

HardenedBSD/src f2164d2. ObsoleteFiles.inc, usr.sbin/apm apm.8 Makefile

apm(8): Drop MLINK to apmconf(8)

apmconf(8) was merged into apm(8) back in 2000 and this note and MLINK
were added as a transition aid, but that aid is no longer needed.

(cherry picked from commit daa1f9b415f3bca82cc7a6e555c9c56e1b1c44f5)
DeltaFile
+1-8usr.sbin/apm/apm.8
+3-0ObsoleteFiles.inc
+0-1usr.sbin/apm/Makefile
+4-93 files

HardenedBSD/src fe91342. ObsoleteFiles.inc, usr.sbin/apm apm.8 Makefile

apm(8): Drop MLINK to apmconf(8)

apmconf(8) was merged into apm(8) back in 2000 and this note and MLINK
were added as a transition aid, but that aid is no longer needed.

(cherry picked from commit daa1f9b415f3bca82cc7a6e555c9c56e1b1c44f5)
DeltaFile
+1-8usr.sbin/apm/apm.8
+3-0ObsoleteFiles.inc
+0-1usr.sbin/apm/Makefile
+4-93 files

HardenedBSD/src 391e870share/man/man9 printf.9

printf.9: fix style

Follow the style described by style.9.

Reported by:    markj
MFC after:      1 week
DeltaFile
+1-2share/man/man9/printf.9
+1-21 files

HardenedBSD/src a9d8eb9. ObsoleteFiles.inc, share/man/man4 pcic.4 exca.4

pcic.4: Remove stale manual

Extracted from: https://reviews.freebsd.org/D53434

(cherry picked from commit 1d9f2db7c0b981bf5d45e3ef17dda13b953e1c97)
(cherry picked from commit 6aaf184dc4e294779db7133629b7ae953b4da285)
DeltaFile
+0-100share/man/man4/pcic.4
+1-2share/man/man4/exca.4
+2-1ObsoleteFiles.inc
+0-1share/man/man4/Makefile
+0-1share/man/man4/ath.4
+3-1055 files

HardenedBSD/src 0002b1d. ObsoleteFiles.inc, share/man/man4 pccard.4 pccbb.4

Retire pccard(4)

pccard has been declared obsolete for a long time and also the
support has been removed but the man page still exists. It mentions
being scheduled to be removed before 13.0 but it still exists in the
tree.

[Extracted from review D53434]

(cherry picked from commit 5b9fba1cb0d84ee297908ec4d575c33cf1f68ad5)
(cherry picked from commit 8a8c58f71e80e186da3679266eef54f4180e4d11)
DeltaFile
+0-78share/man/man4/pccard.4
+0-5share/man/man9/bus_alloc_resource.9
+1-4share/man/man9/DEVICE_DETACH.9
+3-0ObsoleteFiles.inc
+1-2share/man/man4/pccbb.4
+1-2usr.sbin/dumpcis/dumpcis.8
+6-913 files not shown
+6-949 files

HardenedBSD/src 3a25f21sys/conf kmod.mk

kmod.mk: Remove a trailing reference to pccarddevs.h

Fixes:          31b35400cf77 ("pccard: Remove more of the PC Card infrastructure")
(cherry picked from commit 6bf611ada21216aefcd830ba71fbf0b5d776ea47)
DeltaFile
+1-1sys/conf/kmod.mk
+1-11 files

HardenedBSD/src c650464sys/conf kmod.mk

kmod.mk: Remove a trailing reference to pccarddevs.h

Fixes:          31b35400cf77 ("pccard: Remove more of the PC Card infrastructure")
(cherry picked from commit 6bf611ada21216aefcd830ba71fbf0b5d776ea47)
DeltaFile
+1-1sys/conf/kmod.mk
+1-11 files

HardenedBSD/src ca2413dlib/librt mq_getfd_np.3 Makefile

librt/mq_getfd_np.3: Initial manual page

The mq_getfd_np function appeared in FreeBSD 11 with no documentation.
This function dereferences the mqd_t as a pointer to an int.

Relnotes:               yes
MFC after:              3 days
Reviewed by:            kib (previous), markj, ziaee
Differential Revision:  https://reviews.freebsd.org/D43947
DeltaFile
+57-0lib/librt/mq_getfd_np.3
+2-0lib/librt/Makefile
+59-02 files

HardenedBSD/src 7f3da1fsys/modules Makefile

aq(4): Build on x86 only for now

It fails to build on arm64.  As it is experimental and in development
just limit it to x86 until this is fixed.

Reported by:            brd
Fixes: 75177aebf039 ("aq(4): Add build infrastructure")
DeltaFile
+2-1sys/modules/Makefile
+2-11 files

HardenedBSD/src 55ce126sys/kern kern_racct.c

kern: racct: Remove code unused since %cpu resource computation revamp

Reviewed by:    emaste, markj
Fixes:          c72188d85a79 ("racct: Improve handling of the pcpu resource")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54284
DeltaFile
+0-133sys/kern/kern_racct.c
+0-1331 files

HardenedBSD/src 108b5d9share/man/man9 bus_alloc_resource.9, sys/kern subr_bus.c

bus_alloc_resource: First step in passing resource IDs by value

Add wrapper inline functions for bus_alloc_resource* that accept a
resource ID by value (instead of a pointer).  The rest of the bus
resource API (outside of compat shims) does not accept resource IDs as
arguments, but instead obtains the resource ID from the resource
itself when needed.  As such, there is no reason to return any
potentially modified resource IDs to the caller.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D53401

(cherry picked from commit 7eb213614b90cde31707a53c4b8ae6acacf2aa0f)
DeltaFile
+42-0sys/sys/bus.h
+7-17share/man/man9/bus_alloc_resource.9
+1-1sys/kern/subr_bus.c
+1-1sys/sys/param.h
+51-194 files

HardenedBSD/src 3fbce83share/man/man9 bus_alloc_resource.9, sys/kern subr_bus.c

bus_alloc_resource: First step in passing resource IDs by value

Add wrapper inline functions for bus_alloc_resource* that accept a
resource ID by value (instead of a pointer).  The rest of the bus
resource API (outside of compat shims) does not accept resource IDs as
arguments, but instead obtains the resource ID from the resource
itself when needed.  As such, there is no reason to return any
potentially modified resource IDs to the caller.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D53401

(cherry picked from commit 7eb213614b90cde31707a53c4b8ae6acacf2aa0f)
DeltaFile
+42-0sys/sys/bus.h
+7-17share/man/man9/bus_alloc_resource.9
+1-1sys/kern/subr_bus.c
+1-1sys/sys/param.h
+51-194 files

HardenedBSD/src 5c1d9dfshare/man/man9 vmem.9

vmem.9: provide a reference to libuvmem(3)

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+3-0share/man/man9/vmem.9
+3-01 files

HardenedBSD/src ca10598sys/dev/ice ice_lib.c

ice(4): Remove unused function

rss_getkey function is now available even if kernel RSS option
is disabled. This makes ice_get_default_rss_key no longer needed.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>

Reviewed by:    gallatin
Approved by:    kbowling (mentor)
Fixes:          012ecdde3a810 ("ice: use newly exposed RSS hash key API rather than ad-hoc hashing")
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D54281
DeltaFile
+4-32sys/dev/ice/ice_lib.c
+4-321 files

HardenedBSD/src 7c02ba0sys/netpfil/pf pf_nl.c

pf: Fix the reply command in a couple of places

libpfctl doesn't notice the mismatch.

Reported by:    Kevin Day <kevin at your.org>
Reviewed by:    kp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54199
DeltaFile
+2-2sys/netpfil/pf/pf_nl.c
+2-21 files

HardenedBSD/src 9381188sys/dev/random armv8rng.c

armv8rng: Fix an inverted test in random_rndr_read_one()

If we get a random number, the NZCV is set to 0b0000.  Then
"cset %w1, ne" will test whether Z == 0 and set %w1 to 1 if so.
More specifically, "cset %w1, ne" maps to "csinc %w1, wzr, wzr, eq",
which stores 0 in %w1 when NZCV == 0b0100 and 1 otherwise.

Thus, on a successful read we expect ret != 0, so the loop condition
needs to be fixed.  In practice this means that we would end up trying
to fetch entropy up to ten times in a row.  If all attempts are
successful, the last will be returned, otherwise no entropy will be
returned.

Reported by:    Kevin Day <kevin at your.org>
Reviewed by:    andrew
Fixes:          9eecef052155 ("Add an Armv8 rndr random number provider")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54259
DeltaFile
+1-1sys/dev/random/armv8rng.c
+1-11 files

HardenedBSD/src 0d469d2sys/net if.c if_private.h, sys/netinet in.c

net: attach IPv4 and IPv6 stacks to an interface with EVENTHANDLER(9)

This change retires two historic relics: the if_afdata[] array and the
dom_ifattach/dom_ifdetach methods.

The if_afdata[] array is a relic of the era, when there was expectation
that many transport protocols will coexist with IP, e.g. IPX or NetAtalk.
The array hasn't had any members except AF_INET and AF_INET6 for over a
decade already. This change removes the array and just leaves two pointer
fields: if_inet and if_inet6.

The dom_ifattach/dom_ifdetach predates the EVENTHANDLER(9) framework and
was a good enough method to initialize protocol contexts back then.  Today
there is no good reason to treat IPv4 and IPv6 stacks differently to other
protocols/features that attach and detach from an interface.

The locking of if_afdata[] is a relic of SMPng times, when the system
startup and the interface attach was even more convoluted than before this
change, and we also had unloadable protocols that used a field in

    [14 lines not shown]
DeltaFile
+10-112sys/net/if.c
+54-44sys/netinet/in.c
+14-35sys/netinet6/in6.c
+37-2sys/netinet6/in6_ifattach.c
+2-17sys/net/if_private.h
+5-6sys/netinet6/in6_var.h
+122-21622 files not shown
+173-25828 files

HardenedBSD/src 713b57csys/net if_var.h if.c, sys/netlink/route iface.c

net: split ifnet_arrival_event into two events

Run the original ifnet_arrival_event before linking the interface.
Otherwise there is a race window when interface is already visible, but
not all of the protocols have completed their attach. Provide a new event
handler ifnet_attached_event, that is executed when the inteface is fully
visible.  Use it in route(4) socket and netlink(4) to announce new
interface to the userland. Properly document the ifnet events in if_var.h.

Reviewed by:            zlei, melifaro
Differential Revision:  https://reviews.freebsd.org/D54085
DeltaFile
+17-6sys/net/if_var.h
+2-3sys/net/if.c
+2-2sys/net/rtsock.c
+1-1sys/netlink/route/iface.c
+22-124 files

HardenedBSD/src fb1994eshare/man/man4 aq.4 Makefile

aq(4): Add man page

Reviewed by:    ziaee
Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53840
DeltaFile
+56-0share/man/man4/aq.4
+1-0share/man/man4/Makefile
+57-02 files