FreeBSD/src 8fe76a3usr.sbin/blacklistd blacklistd.conf

blacklistd: Fix RFC1918 typo

This is a direct commit to the stable/14 branch, partially cherry picked
from commit 5a6d9479ae2271a97dd23ceee8ad284770302874, as the stable/14
branch only has blacklistd.

The address in the configuration file example was intended to be from
the 192.168.0.0/16 range of IPv4 private addresses (RFC1918).

Reported on mastodon.social at
https://mastodon.social/@asmodai/116316630762241486.

Fix submitted upstream by emaste@.  Fixing locally first.

Reported by:    asmodai
Reviewed by:    emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56773
DeltaFile
+1-1usr.sbin/blacklistd/blacklistd.conf
+1-11 files

FreeBSD/src 0f36cf8usr.sbin/blacklistd blacklistd.conf, usr.sbin/blocklistd blocklistd.conf

blocklistd: Fix RFC1918 typo

The address in the configuration file example was intended to be from
the 192.168.0.0/16 range of IPv4 private addresses (RFC1918).

Reported on mastodon.social at
https://mastodon.social/@asmodai/116316630762241486.

Fix submitted upstream by emaste@.  Fixing locally first.

Reviewed by:    emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56773

(cherry picked from commit 5a6d9479ae2271a97dd23ceee8ad284770302874)
DeltaFile
+1-1usr.sbin/blacklistd/blacklistd.conf
+1-1usr.sbin/blocklistd/blocklistd.conf
+2-22 files

FreeBSD/src 3ca8ec1lib/libc/gen posix_spawn.c

libc: correct posix_spawn_file_actions_init ENOMEM error

The return value of posix_spawn_file_actions_init() is an error number.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56911
DeltaFile
+1-1lib/libc/gen/posix_spawn.c
+1-11 files

FreeBSD/src b333b87sys/kern uipc_shm.c

uipc_shm.c: make large page allocation interruptible

Approved by:    re (cperciva)

(cherry picked from commit 839d3266d8c6f6471cb92a3c0ae32eb16d117427)
(cherry picked from commit c335dafd77363b67493d37ab260bc82e70c8cfa7)
DeltaFile
+8-0sys/kern/uipc_shm.c
+8-01 files

FreeBSD/src 037b285sys/kern uipc_usrreq.c, tests/sys/kern unix_stream.c

unix: Make sure we signal EOF on the write side when disconnecting

Add a regression test.

Approved by:    re (cperciva)
PR:             294014
Reported by:    diizzy
Reviewed by:    glebius
MFC after:      1 week
Fixes:          d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket")
Differential Revision:  https://reviews.freebsd.org/D56764

(cherry picked from commit 476805133f5736c2c8638e41d2b5d8dd2c597f3a)
(cherry picked from commit f06697907f360b02682594c6179a7361644d3c87)
DeltaFile
+62-19tests/sys/kern/unix_stream.c
+2-0sys/kern/uipc_usrreq.c
+64-192 files

FreeBSD/src f066979sys/kern uipc_usrreq.c, tests/sys/kern unix_stream.c

unix: Make sure we signal EOF on the write side when disconnecting

Add a regression test.

PR:             294014
Reported by:    diizzy
Reviewed by:    glebius
MFC after:      1 week
Fixes:          d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket")
Differential Revision:  https://reviews.freebsd.org/D56764

(cherry picked from commit 476805133f5736c2c8638e41d2b5d8dd2c597f3a)
DeltaFile
+62-19tests/sys/kern/unix_stream.c
+2-0sys/kern/uipc_usrreq.c
+64-192 files

FreeBSD/src ad2fff6tests/sys/netinet carp.sh

tests/carp: make a 0.2 second pause before configuring second jail

for all scenarios where both jails have same priority/advskew.  There is a
tiny chance that on both sides carp_master_down() will be executed in
parallel and advertisements will also fly through the bridge(4) in
parallel, thus both sides will switch to MASTER before receiving the
announcement from peer.  This makes the test to fail.  So far this
flakyness was observed for carp:vrrp_v4 only, but in theory it is possible
for any of the patched scenarios.

Note that this sleep does not prolong execution of the tests, as the first
jail is already configured, and if we slept before configuring the second,
we would sleep less in wait_for_carp().

(cherry picked from commit 27ff90cd3d8d2ac8198f30cbebeefb15a49d41bc)
DeltaFile
+7-0tests/sys/netinet/carp.sh
+7-01 files

FreeBSD/src 107ef0ctests/sys/netinet carp.sh

tests/carp: Rework unicast_v4

For unicast tests, it is sufficient to use wait_for_carp() to verify
the setup is sane. Additional sanity checks are not necessarily
required but can serve purpose for redundancy.

For some unclear reason routed(8) is advertising route to carp BACKUP.
That makes the test flaky. Also routed(8) is marked deprecated and may
be removed from base in the future. Let's just add static route entry
manually for additional sanity checks.

Other noticeable changes:
  1. Add atf_check to configuration steps to prevent potential failure
on setup. That helps diagnosing on failure.
  2. Shorten the names of jails to improve readability.
  3. Prefer `[ifconfig|route|sysctl] -j` over `jexec [ifconfig|route|sysctl]`
to make the lines shorter.

MFC note: At the time writing, routed(8) does not know carp addresses

    [10 lines not shown]
DeltaFile
+44-36tests/sys/netinet/carp.sh
+44-361 files

FreeBSD/src 332485atests/sys/netinet carp.sh

tests/carp: make sleep interval in the wait loop smaller

Makes tests to finish slightly faster.

(cherry picked from commit e353cbffd600ae3c00c8584dddcabf9d0ae1202a)
DeltaFile
+1-1tests/sys/netinet/carp.sh
+1-11 files

FreeBSD/src 89096d6tests/sys/netinet carp.sh

tests/carp: kill routed(8) before destroying interfaces

Otherwise routed logs a warning:

"MCAST_LEAVE_GROUP ALLROUTERS: Can't assign requested address"

that may be misinterpreted as a problem.

(cherry picked from commit 8596810d02a1e361e0312d116339aa106aca4b19)
DeltaFile
+3-0tests/sys/netinet/carp.sh
+3-01 files

FreeBSD/src fdd7daasys/dev/thunderbolt tbcfg_reg.h

thunderbolt: Fix typo in comment

Reported by:    adrian
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/dev/thunderbolt/tbcfg_reg.h
+1-11 files

FreeBSD/src 27ad506contrib/bsnmp oid-list

Document some more OIDs that are used by bsnmp.
DeltaFile
+18-0contrib/bsnmp/oid-list
+18-01 files

FreeBSD/src 7906084contrib/bsnmp/snmp_mibII mibII.c

Fix some memory leaks when fetching the mibII.

Reviewed by:    glebius
Sponsored by:   Netflix
Differential Revision:  <https://reviews.freebsd.org/D55998>
DeltaFile
+6-0contrib/bsnmp/snmp_mibII/mibII.c
+6-01 files

FreeBSD/src 6499888lib/geom/part gpart.8

gpart(7): Fix reference to the zfsprops man page

PR:     292147
DeltaFile
+2-2lib/geom/part/gpart.8
+2-21 files

FreeBSD/src 0cd655fsys/netpfil/pf pf_ioctl.c, tests/sys/netpfil/pf match.sh

pf: do not reject rules with colliding hashes

We insert rules in pf_krule_global solely for the benefit of the
'keepcounters' feature. Failing to insert (beause the rule hash
collides, or an identical rule already exists) would be worse than
restoring counts to the wrong rule (or failing to restore them at all).

PR:             282863, 294860, 294859, 294858
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D56745

(cherry picked from commit a0e4c65f1814a7a677364dc29bb703f84323d175)
DeltaFile
+36-0tests/sys/netpfil/pf/match.sh
+8-16sys/netpfil/pf/pf_ioctl.c
+44-162 files

FreeBSD/src 555ffd9sys/dev/pci pci.c

pci: use uint32_t for eecp

eecp holds the extended capability offset. If that offset is larger
than 0xff, storing it in uint8_t truncates it, which can make the
early EHCI/XHCI capability walk read the wrong location and loop during
boot.

Seen on AMD device 1022:151e, where HCCPARAMS1 = 0x0118ffc5 and the
first xHCI extended capability offset is 0x460. Widen eecp to uint32_t
in xhci_early_takeover(), matching xhci_pci_take_controller().

Signed-off-by: Gisle Nes <gisle at gisle.net>
Reviewed by:    zlei, aokblast
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2127
Closes:         https://github.com/freebsd/freebsd-src/pull/2127
DeltaFile
+1-1sys/dev/pci/pci.c
+1-11 files

FreeBSD/src 44338ccetc/mtree BSD.root.dist

BSD.root.dist: Correct tag for /etc/sysctl.kld.d

This is only used by rc.subr and belongs in rc, not runtime.

Fixes:          fa6d67cd16b5 ("BSD.root.dist: Add package tag for all directories")
MFC after:      3 days
Reviewed by:    ivy
Differential Revision:  https://reviews.freebsd.org/D56900
DeltaFile
+1-1etc/mtree/BSD.root.dist
+1-11 files

FreeBSD/src 072f79dsys/x86/cpufreq hwpstate_amd.c

hwpstate_amd: Initialize CPPC driver type

Assign the driver type instead of preserving uninitialized stack data

PR:     294899
Reviewed by:    aokblast
DeltaFile
+1-1sys/x86/cpufreq/hwpstate_amd.c
+1-11 files

FreeBSD/src fab9bfcsys/netpfil/pf pf_ioctl.c, tests/sys/netpfil/pf match.sh

pf: do not reject rules with colliding hashes

We insert rules in pf_krule_global solely for the benefit of the
'keepcounters' feature. Failing to insert (beause the rule hash
collides, or an identical rule already exists) would be worse than
restoring counts to the wrong rule (or failing to restore them at all).

PR:             282863, 294860, 294859, 294858
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D56745

(cherry picked from commit a0e4c65f1814a7a677364dc29bb703f84323d175)
DeltaFile
+36-0tests/sys/netpfil/pf/match.sh
+8-16sys/netpfil/pf/pf_ioctl.c
+44-162 files

FreeBSD/src 10e342csbin/fsck_msdosfs fat.c

fsck_msdosfs: fix FAT header correction not persisting in cache mode

When fsck_msdosfs runs with FAT32 cache mode (used for large
filesystems that cannot be mmap'd), a detected FAT header correction
was written into the in-memory buffer but the corresponding cache
entry (fat32_cache_allentries[0]) was never marked dirty.  As a
result, fat_flush_fat32_cache_entry() skipped it, the corrected
bytes were never written to disk, and copyfat() propagated the
uncorrected on-disk data to all backup FAT copies.  Every subsequent
fsck run would repeat the same "FAT starts with odd byte sequence /
FIXED" cycle indefinitely.

Fix by marking fat32_cache_allentries[0].dirty = true after applying
the in-memory correction, ensuring the chunk is flushed before
copyfat() runs.

Obtained from:  https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/4047981
MFC after:      3 days
DeltaFile
+11-0sbin/fsck_msdosfs/fat.c
+11-01 files

FreeBSD/src 1bef553sys/dev/cxgbe t4_main.c, sys/dev/cxgbe/common t4_regs.h

cxgbe(4): Updates to the hw and fw headers and config file

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+99-8sys/dev/cxgbe/firmware/t4fw_interface.h
+22-29sys/dev/cxgbe/common/t4_regs.h
+11-8sys/dev/cxgbe/firmware/t7fw_cfg.txt
+11-8sys/dev/cxgbe/firmware/t7fw_cfg_uwire.txt
+11-4sys/dev/cxgbe/t4_main.c
+154-575 files

FreeBSD/src 9432351sys/arm/include _types.h, sys/arm64/include _types.h

types: provide __SIZEOF_{INT{8,16,32,64},TIME,TIME32}_T

Suggested by:   kib
Reviewed by:    imp, kib
Discussed with: emaste, jrtc27
Differential Revision:  https://reviews.freebsd.org/D56783
DeltaFile
+5-0sys/sys/_types.h
+2-0sys/sys/abi_types.h
+2-0sys/x86/include/_types.h
+1-0sys/riscv/include/_types.h
+1-0sys/arm/include/_types.h
+1-0sys/arm64/include/_types.h
+12-01 files not shown
+13-07 files

FreeBSD/src 324d53csys/sys time.h

sys/time: rework saturation ifdef to avoid direct arch ref

Suggested by:   kib
Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D56401
DeltaFile
+2-2sys/sys/time.h
+2-21 files

FreeBSD/src d9b272acontrib/llvm-project/clang/lib/Sema AnalysisBasedWarnings.cpp

Merge commit 871038759afb from llvm git (by Marco Elver):

  Thread Safety Analysis: Fix pointer handling of variables with deprecated attributes (#148974)

  de10e44b6fe7 ("Thread Safety Analysis: Support warning on
  passing/returning pointers to guarded variables") added checks for
  passing pointer to guarded variables. While new features do not
  necessarily need to support the deprecated attributes (`guarded_var`,
  and `pt_guarded_var`), we need to ensure that such features do not cause
  the compiler to crash.

  As such, code such as this:

          struct {
            int v __attribute__((guarded_var));
          } p;

          int *g() {
            return &p.v;  // handleNoMutexHeld() with POK_ReturnPointer

    [24 lines not shown]
DeltaFile
+20-5contrib/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp
+20-51 files

FreeBSD/src cab150fsys/sys time.h

sys/time: appease gcc -Wtype-limits

In environments where time_t is 32 bits, including the 32-bit library
build on amd64, the overflow being tested for cannot happen, and gcc
complains with -Wtype-limits, causing the gcc build to fail.  Work
around this by ifdef'ing out the saturation code on i386.

Reviewed by:    imp, jfree
Discussed with: markj
Fixes:  e3799530b3ba ("sys/time: Add saturating sbt conversions")
Differential Revision:  https://reviews.freebsd.org/D56369

(cherry picked from commit 00dccc3164c6dff38350a1baeeea7238acf2efc3)
DeltaFile
+4-0sys/sys/time.h
+4-01 files

FreeBSD/src bd1e789. Makefile.inc1

Make "make update-packages" idempotent

If the user runs "make update-packages" without bumping BRANCH, then it
isn't possible to copy packages from the old location to the new one
(because the two locations are the same).  So just skip that step.

Sponsored by:           ConnectWise
PR:                     295085
MFC after:              1 week
Reviewed by:            ivy, emaste
Differential Revision:  https://reviews.freebsd.org/D56872
DeltaFile
+3-1Makefile.inc1
+3-11 files

FreeBSD/src 57efbb1sys/arm/include _stdint.h, sys/arm64/include _stdint.h

Define stdint.h macros unconditionally

Similar to glibc, define all the stdint.h macros such as `SIZE_MAX`,
`UINT64_C`, etc unconditionally. I.e. no longer check whether
`__STDC_CONSTANT_MACROS` or `__STDC_LIMIT_MACROS` are defined. See also
<https://sourceware.org/bugzilla/show_bug.cgi?id=15366>.

This is part of reverting base 00bee6fcd77f, which reverted an upstream
libc++ commit that eliminated libc++'s stdint.h wrapper header.

Submitted by:   Nikolas Klauser <nikolasklauser at berlin.de>
MFC after:      1 week
Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D56746

(cherry picked from commit 966fb94cb3575ccd39da211165d0858fd0eb0ef2)
DeltaFile
+0-8sys/arm/include/_stdint.h
+0-8sys/arm64/include/_stdint.h
+0-8sys/powerpc/include/_stdint.h
+0-8sys/riscv/include/_stdint.h
+0-8sys/x86/include/_stdint.h
+0-405 files

FreeBSD/src 9a69511sys/powerpc/include _stdint.h, sys/riscv/include _stdint.h

Remove extraneous tab characters at EOL in various _stdint.h files

MFC after:      3 days

(cherry picked from commit daeab702f9adbbb718ecf48e17de8dd619cfe7b8)
DeltaFile
+2-2sys/powerpc/include/_stdint.h
+1-1sys/riscv/include/_stdint.h
+1-1sys/x86/include/_stdint.h
+4-43 files

FreeBSD/src 4699fffsys/powerpc/include _stdint.h, sys/riscv/include _stdint.h

Remove extraneous tab characters at EOL in various _stdint.h files

MFC after:      3 days

(cherry picked from commit daeab702f9adbbb718ecf48e17de8dd619cfe7b8)
DeltaFile
+2-2sys/powerpc/include/_stdint.h
+1-1sys/riscv/include/_stdint.h
+1-1sys/x86/include/_stdint.h
+4-43 files

FreeBSD/src c70f196sys/arm/include _stdint.h, sys/arm64/include _stdint.h

Define stdint.h macros unconditionally

Similar to glibc, define all the stdint.h macros such as `SIZE_MAX`,
`UINT64_C`, etc unconditionally. I.e. no longer check whether
`__STDC_CONSTANT_MACROS` or `__STDC_LIMIT_MACROS` are defined. See also
<https://sourceware.org/bugzilla/show_bug.cgi?id=15366>.

This is part of reverting base 00bee6fcd77f, which reverted an upstream
libc++ commit that eliminated libc++'s stdint.h wrapper header.

Submitted by:   Nikolas Klauser <nikolasklauser at berlin.de>
MFC after:      1 week
Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D56746

(cherry picked from commit 966fb94cb3575ccd39da211165d0858fd0eb0ef2)
DeltaFile
+0-8sys/arm/include/_stdint.h
+0-8sys/arm64/include/_stdint.h
+0-8sys/powerpc/include/_stdint.h
+0-8sys/riscv/include/_stdint.h
+0-8sys/x86/include/_stdint.h
+0-405 files