FreeBSD/src a317317 — lib/libpfctl libpfctl.c, sys/netpfil/pf pf_nl.h pf_ioctl.c

pf: Keep every chunk of a table that a ruleset defines

libpfctl sends a table definition in chunks of 256 addresses, each as
its own PFNL_CMD_INA_DEFINE.  The kernel treated every chunk as a new
definition and replaced the shadow table, so only the last chunk
survived.

Mark the chunks after the first with PF_ID_APPEND and have the kernel
add them to the shadow table in progress.  A request without the
attribute still replaces the shadow; one with it and no definition in
progress fails with EINVAL.  Old kernels ignore the attribute, so both
halves are needed; the ioctl sends all addresses at once and is not
affected.  Mask the flags userland passes to PFR_FLAG_ALLMASK, as
PFR_FLAG_APPEND is kernel-internal.

Add a test that defines a table of 1,000 addresses, also in an anchor.

Reviewed by:            kp
Fixes:                  219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")

    [2 lines not shown]
DeltaFile
+70-0tests/sys/netpfil/pf/table.sh
+59-0sys/netpfil/pf/pf_table.c
+8-2lib/libpfctl/libpfctl.c
+5-0sys/netpfil/pf/pf_nl.c
+2-1sys/netpfil/pf/pf_ioctl.c
+1-0sys/netpfil/pf/pf_nl.h
+145-31 files not shown
+146-37 files

FreeBSD/src 6aa2c65 — sys/dev/spibus/controller/rockchip rk_spi.c

rk_spi: Do not change the clock with the driver lock held

The clock framework can sleep, it takes the clock topology sx lock.  Calling
clk_set_freq() and clk_get_freq() from rk_spi_hw_setup() with the driver
mutex held triggers a witness warning about a sleepable lock acquired after
a non-sleepable one, on the first transfer that raises the clock.

Set the clock in a new function that is called before taking the lock, and
only keep the register setup under the lock.
DeltaFile
+27-6sys/dev/spibus/controller/rockchip/rk_spi.c
+27-61 files

FreeBSD/src b82b744 — lib/libc/gen syslog.c getgrent.c, lib/libc/iconv bsd_iconv.c

libc: Preserve const qualifier on strchr(3), strrchr(3), and memchr(3) results

Reviewed by:    dteske, fuz
Approved by:    dteske (mentor), fuz (mentor)
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59612

(cherry picked from commit 73d3c964be93034daf26a55ebac38c2152769f74)
DeltaFile
+4-3lib/libc/net/getaddrinfo.c
+2-2lib/libc/gen/getgrent.c
+1-2lib/libc/iconv/bsd_iconv.c
+2-1lib/libc/inet/inet_cidr_pton.c
+2-1lib/libc/gen/syslog.c
+1-1lib/libc/stdio/mktemp.c
+12-104 files not shown
+16-1410 files

FreeBSD/src 13d25dc — include wchar.h, sys/powerpc/include _stdint.h

libc: Add WCHAR_WIDTH in <wchar.h> as well

Define __WCHAR_WIDTH in sys/_types.h and derive WCHAR_WIDTH from
that, the same way as WCHAR_MIN and WCHAR_MAX, in both <wchar.h>
and <stdint.h> as per C23 §7.31.1 and §7.22.3.4, respectively.

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59385

(cherry picked from commit 72ed6f9c9dc95124cd81158d1c4437484a1b951e)
DeltaFile
+3-0sys/sys/stdint.h
+3-0include/wchar.h
+2-0sys/sys/_types.h
+0-1sys/x86/include/_stdint.h
+0-1sys/riscv/include/_stdint.h
+0-1sys/powerpc/include/_stdint.h
+8-32 files not shown
+8-58 files

FreeBSD/src 6ab9d00 — sys/arm/include _inttypes.h, sys/arm64/include _inttypes.h

libc: Add PRIb*, PRIB*, and SCNb* macros as per C23

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59293

(cherry picked from commit ab420c44bc7c45bf344cb03b289e60109f57aaee)
DeltaFile
+45-0sys/x86/include/_inttypes.h
+45-0sys/riscv/include/_inttypes.h
+45-0sys/powerpc/include/_inttypes.h
+45-0sys/arm64/include/_inttypes.h
+45-0sys/arm/include/_inttypes.h
+225-05 files

FreeBSD/src dca5970 — include stdbool.h

libc: Remove incorrectly defined __STDC_VERSION_STDBOOL_H__

C23 does not define __STDC_VERSION_STDBOOL_H__ for <stdbool.h>.
Feature test macros of this form only apply to headers where the
standard explicitly mandates one.

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D59136

(cherry picked from commit 2712d1380fcd8dd61d043b2242f20767e8f2f347)
DeltaFile
+0-4include/stdbool.h
+0-41 files

FreeBSD/src 8f76613 — include stdio.h

libc: Add _PRINTF_NAN_LEN_MAX per C23

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D58842

(cherry picked from commit 10d5a548596ce7c111ea4a463d3f7d5f0cb1ae4f)
DeltaFile
+4-0include/stdio.h
+4-01 files

FreeBSD/src d3bad28 — share/misc bsd-family-tree

bsd-family-tree: polish grammar and style

Reviewed by:    ziaee
DeltaFile
+28-26share/misc/bsd-family-tree
+28-261 files

FreeBSD/src a2a0e5e — sys/netpfil/pf pf.c

pf: check extension header length.

pf_walk_header6() advances the packet offset for each IPv6 extension
header.  It was not checked that this does not exceed the packet
length if no next header was processed.  When used with af-to rules,
this could trigger a panic: m_copydata: null mbuf.

from Acts1631; OK henning@ sashan@

MFC after:      1 week
Obtained from:  OpenBSD, bluhm <bluhm at openbsd.org>, 6d56112588
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit ccb19b359aae4b7e7315ad61d33d9a35d85849d1)
DeltaFile
+14-3sys/netpfil/pf/pf.c
+14-31 files

FreeBSD/src 3cbfe09 — sys/netpfil/pf pf.c

pf: check AH header length.

pf_walk_header() advances the packet offset for each AH extension
header.  It was not checked that this does not exceed the packet
length if no next header was processed.  Fix it like in IPv6.

OK henning@ sashan@

MFC after:      1 week
Obtained from:  OpenBSD, bluhm <bluhm at openbsd.org>, fcd4e5522e
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit b4d2c9835c0edfddd1d6742afa86d4873ccfad16)
DeltaFile
+11-2sys/netpfil/pf/pf.c
+11-21 files

FreeBSD/src e6fb3b5 — sys/sys vnode.h

vfs: unbreak builds when MAC is not defined

Sorts out powerpc.QORIQ64 build failure.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+9-0sys/sys/vnode.h
+9-01 files

FreeBSD/src dbbff47 — sys/dev/gve gve_tx_dqo.c, sys/dev/random random_harvestq.c

Retire bogus predicts on case statements.

They are ignored by clang.

No functional changes (nor .o changes).

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+3-3sys/kern/kern_malloc.c
+1-1sys/dev/random/random_harvestq.c
+1-1sys/dev/gve/gve_tx_dqo.c
+5-53 files

FreeBSD/src 93c05b7 — release/tools oci-image-static.conf

OCI: Remove dead code

We don't need to pick a repository URL when all we're doing is enabling
one which was specified in /etc/pkg/.

Reviewed by:    dch, imp
Fixes:  c73ae6734899 ("release/tools: use same pkg settings ...")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60868
DeltaFile
+0-8release/tools/oci-image-static.conf
+0-81 files

FreeBSD/src 97b9e96 — share/misc bsd-family-tree

bsd-family-tree: add OpenBSD 8.0
DeltaFile
+2-1share/misc/bsd-family-tree
+2-11 files

FreeBSD/src e45c7bc — sys/compat/linux linux_dummy.c linux_misc.c

linux: implement sched_getattr()

This change adds the necessary glue to translate Linux scheduler policy
and priority from FreeBSD so this information is available to Linux
applications.

Please note that this change does not fill in the `.sched_nice` property: this
will be handled in a follow up commit (see bug 299617 for more details).

This unbreaks using the Linux version of Chromium on FreeBSD.

PR:     297468
Signed-off-by:  Joao Bonifacio <joaoboni017 at gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/2370
Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D60214
DeltaFile
+112-0sys/compat/linux/linux_misc.c
+0-1sys/compat/linux/linux_dummy.c
+112-12 files

FreeBSD/src c915397 — sys/netpfil/pf pflow.c

pflow: Destroy exporters on module unload

Since 83641335f96c only jail removal destroys exporters.  Unloading
pflow with one left trips the assertion in vnet_pflowdetach() or,
without INVARIANTS, leaves pf calling into the freed module the next
time it removes a state that pflow exports.

Reviewed by:    kp
Fixes:          83641335f96c ("pf: clean up pflow sockets on jail removal")
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+5-1sys/netpfil/pf/pflow.c
+5-11 files

FreeBSD/src 96944ab — sbin/pfctl pfctl.c parse.y

pfctl: Report why a table definition failed

pfctl_ina_define() returns an error number instead of setting errno, but
both of its callers print errno.  A table that failed to load was
reported as "cannot define table t: No error: 0", or with a stale errno,
both in the main ruleset (process_tabledef()) and in anchors
(pfctl_load_tables()).

Reviewed by:    kp
Fixes:          219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+4-3sbin/pfctl/parse.y
+1-1sbin/pfctl/pfctl.c
+5-42 files

FreeBSD/src d2df0d4 — share/man/man7 networking.7

networking.7: Scope netif to wlan0

I recently learned that you can restart just wlan0 instead of the entire
netif, which will save you when doing on-device networking like bhyve,
or activting wlan0 when it is booted parked via rc.conf's NOAUTO.

MFC after:              3 days
Reviewed by:            bz, bcr
Discussed with:         emaste
Differential Revision:  https://reviews.freebsd.org/D59586
DeltaFile
+6-6share/man/man7/networking.7
+6-61 files

FreeBSD/src 067c6da — share/man/man4 ossl.4

ossl.4: Canonicalize HARDWARE and add powerpc64

This driver now supports powerpc64, so add that to the list of supported
hardware. Further, rewrite that list into the canonical HARDWARE section
for inclusion in the FreeBSD 16.0 Hardware Release Note.

markj notes that it would be useful to list the CPU features required
for this driver to be usable on these platforms. ngie notes that this
would be good as a table.

Fixes:  5daf8ed625af ("Add GCM support on powerpc64/powerpc64le")
MFC after:              the above was scheduled to but has not mfc yet
Reviewed by:            ngie
Differential Revision:  https://reviews.freebsd.org/D59770
DeltaFile
+17-15share/man/man4/ossl.4
+17-151 files

FreeBSD/src 3680477 — share/man/man4/man4.aarch64 armv8crypto.4

armv8crypto: Canonicalize document description

MFC after:              3 days
Reported by:            fuz
Reviewed by:            fuz
Differential Revision:  https://reviews.freebsd.org/D59730
DeltaFile
+2-2share/man/man4/man4.aarch64/armv8crypto.4
+2-21 files

FreeBSD/src daca1e1 — lib/libpmc pmc.perf.3

pmc.perf.3: Mark only for amd64 architecture

Manual pages have an optional architecture specifier after the section
number in the document title macro. I highly recommend using it when
expedient, the extra information is available programmatically and it
uses no extra lines in the rendered page.

MFC after:              No, pmc.perf.3 is not MFCing
Reviewed by:            Anderson Nascimento <anascime at amd.com>
Differential Revision:  https://reviews.freebsd.org/D60714
DeltaFile
+1-1lib/libpmc/pmc.perf.3
+1-11 files

FreeBSD/src 4488a4f — sys/netinet in_pcb.h in_pcb.c

inpcb: make ipport_randomized static
DeltaFile
+2-1sys/netinet/in_pcb.c
+0-2sys/netinet/in_pcb.h
+2-32 files

FreeBSD/src 1594fbd — sbin/pfctl pfctl_osfp.c

pfctl: Report the error of a failed fingerprint flush

pfctl_flush_fingerprints() returns an error number instead of setting
errno, so a failed flush was reported with whatever errno held: "No
error: 0" on a kernel with ALTQ, ENODEV from the ALTQ probe on one
without.  Every "pfctl -f" flushes the fingerprints first, so on a
kernel that predates PFNL_CMD_OSFP_FLUSH every ruleset load fails this
way without saying why.

Reviewed by:    kp
Fixes:          75c0a8376204 ("pf: convert DIOCOSFPFLUSH DIOCOSFPGET DIOCOSFPADD to netlink")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+1-1sbin/pfctl/pfctl_osfp.c
+1-11 files

FreeBSD/src 5ce0ab7 — usr.sbin/bhyve gdb.c

bhyve: fix integer overflow in qXfer packet parser

doff + dlen overflows unsigned int when both values are close to UINT_MAX,
causing the wrong branch to execute and passing an unbounded length to
append_binary_data().  Rewrite the comparison to avoid the addition.

Reviewed by:    markj
Fixes:          f81cdf24ba54 ("bhyve: Add support for XML register definitions")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60847
DeltaFile
+1-1usr.sbin/bhyve/gdb.c
+1-11 files

FreeBSD/src f2bba01 — sys/netpfil/ipfw ip_fw_dynamic.c

ipfw: keep flag(s) definition next to member that holds them
DeltaFile
+2-7sys/netpfil/ipfw/ip_fw_dynamic.c
+2-71 files

FreeBSD/src bc9e668 — sys/netpfil/ipfw ip_fw_dynamic.c

ipfw: gc disabled old hashing code

This code was disabled for 8 years already.  It used to produce very
predictable hash without a salt, and that made the dynamic state engine an
easy DoS attack vector.  No chance we will ever use it again.
DeltaFile
+0-34sys/netpfil/ipfw/ip_fw_dynamic.c
+0-341 files

FreeBSD/src 41356c8 — sys/net if_bridge.c, sys/netgraph ng_pptpgre.c

net*: use inlined m_pullup()

Leverage the fact that m_pullup() in an inline function in mbuf.h and let
compiler to do all optimizations.

Mostly mechanical changes, but in few cases surrounding lines are brought
to style(9).  In netinet6, a few input functions changed to set the
input/output `struct mbuf **` pointer to NULL at a single place.

Reviewed by:            pouria, zlei, gallatin
Differential Revision:  https://reviews.freebsd.org/D60689
DeltaFile
+56-113sys/netinet6/icmp6.c
+30-58sys/netipsec/key.c
+25-50sys/net/if_bridge.c
+20-32sys/netinet/ip_carp.c
+17-32sys/netinet/tcp_input.c
+19-26sys/netgraph/ng_pptpgre.c
+167-31187 files not shown
+502-95193 files

FreeBSD/src 671babc — sys/kern uipc_mbuf.c, sys/sys mbuf.h

mbuf: make m_pullup() an inline over most expected case

Implement a most typical use of m_pullup() as an inline and leave only the
heavy part as a function.  A sweeping change to make benefit of the new
version follows.

Reviewed by:            pouria, zlei, gallatin
Differential Revision:  https://reviews.freebsd.org/D60688
DeltaFile
+10-1sys/sys/mbuf.h
+1-1sys/kern/uipc_mbuf.c
+11-22 files

FreeBSD/src 4c72b1c — sys/netgraph ng_pppoe.c

ng_pppoe: fix m_pullup() logic

The clear intent here is to do m_pullup() if we _don't_ have two bytes.
Before the fix: a) m_pullup() was always called and did nothing; b) if a
node was ever supplied with a fragmented but otherwise correct mbuf, then
it would not handle PROT_LCP as intended.

Noticed by:             zlei
Reviewed by:            zlei, eugen_grosbein.net
Differential Revision:  https://reviews.freebsd.org/D60788
Fixes:                  28903f396af4b151e16ea606cda66a9244fb179f
DeltaFile
+1-1sys/netgraph/ng_pppoe.c
+1-11 files

FreeBSD/src 993f846 — sys/arm64/arm64 identcpu.c pmap.c, sys/arm64/include cpu.h

arm64: Fix and rename midr_check_var_part_range()

At the lowest and highest variants in the specified range,
midr_check_var_part_range() was comparing the part number, rather than
the revision, against the bounds.  In other words, the "Y" in "rXpY"
should be compared to CPU_REV() instead of CPU_PART().  Apply this
correction, and rename the function to midr_check_var_rev_range() to
better reflect the field that we are checking.

(cherry picked from commit 39d6e2226484ca434c7d980eda4aa19ed0d62c9e)
DeltaFile
+11-6sys/arm64/include/cpu.h
+2-2sys/arm64/arm64/pmap.c
+1-1sys/arm64/arm64/identcpu.c
+14-93 files