HardenedBSD/src 26536fbbin/sh histedit.c, bin/timeout timeout.1

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+6-6usr.sbin/diskinfo/diskinfo.8
+5-5usr.sbin/diskinfo/diskinfo.c
+5-1bin/timeout/timeout.1
+1-1bin/sh/histedit.c
+17-134 files

HardenedBSD/src 4aef1aebin/sh histedit.c

sh: Increase default history size to POSIX mandated minimum of 128

The default history size in bin/sh is currently 100 however POSIX.1-2024
mandates that a default greater than or equal to 128 shall be used,
therefore this increases the default history size in /bin/sh to 128.

POSIX standards reference:
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sh.html#tag_20_110_08

MFC after:      3 days
Reviewed by:    emaste, jilles, jlduran, ziaee
Signed-off-by:  Kristofer Peterson <kris at tranception.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2093

(cherry picked from commit 81b2055c49dec8884d7bb23503f1dfeac37ac95d)
DeltaFile
+1-1bin/sh/histedit.c
+1-11 files

HardenedBSD/src 240c229usr.sbin/diskinfo diskinfo.8 diskinfo.c

diskinfo: Align and alphabetize options

MFC after:      3 days

(cherry picked from commit afe57c12e97d5c8773d829c2914f35462a7cdd0c)
DeltaFile
+6-6usr.sbin/diskinfo/diskinfo.8
+5-5usr.sbin/diskinfo/diskinfo.c
+11-112 files

HardenedBSD/src 12ca9c6bin/timeout timeout.1

timeout.1: Document non-POSIX options

MFC after:              3 days
Reviewed by:            Aaron Li <aly at aaronly.me>, ziaee
Differential Revision:  https://reviews.freebsd.org/D56090

(cherry picked from commit b1bc748430b5ee79ae103c464dbf5ebc8802f782)
DeltaFile
+5-1bin/timeout/timeout.1
+5-11 files

HardenedBSD/src eb9fc5fshare/man/man4 appleir.4, sys/dev/hid appleir.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+440-0sys/dev/hid/appleir.c
+93-0share/man/man4/appleir.4
+22-20sys/net/bpf.c
+12-3sys/netinet/tcp_lro.c
+0-13sys/vm/vm_swapout.c
+8-0sys/modules/hid/appleir/Makefile
+575-364 files not shown
+580-3810 files

HardenedBSD/src 325ccf2share/man/man4 appleir.4, sys/dev/hid appleir.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+440-0sys/dev/hid/appleir.c
+93-0share/man/man4/appleir.4
+22-20sys/net/bpf.c
+12-3sys/netinet/tcp_lro.c
+0-13sys/vm/vm_swapout.c
+8-0sys/modules/hid/appleir/Makefile
+575-364 files not shown
+580-3810 files

HardenedBSD/src a85c4abshare/man/man4 appleir.4 Makefile, sys/conf files

appleir: Add Apple IR receiver driver

HID driver for Apple IR receivers (USB HID, vendor 0x05ac).
Supports Apple Remote and generic IR remotes using NEC protocol.

Supported hardware:
- Apple IR Receiver (0x8240, 0x8241, 0x8242, 0x8243, 0x1440)

Apple Remote protocol (proprietary 5-byte HID reports):
- Key down/repeat/battery-low detection
- 17-key mapping with two-packet command support
- Synthesized key-up via 125ms callout timer

Generic IR remotes (NEC protocol):
- Format: [0x26][0x7f][0x80][code][~code]
- Checksum: code + ~code = 0xFF
- Default keymap with 8 common codes
- See: https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol


    [9 lines not shown]
DeltaFile
+440-0sys/dev/hid/appleir.c
+93-0share/man/man4/appleir.4
+8-0sys/modules/hid/appleir/Makefile
+1-0sys/conf/files
+1-0share/man/man4/Makefile
+1-0sys/modules/hid/Makefile
+544-06 files

HardenedBSD/src 2d13620sys/netinet tcp_lro.c

tcp lro: fix vnet handling

Reported by:            Shawn Webb
Reviewed by:            glebius, rrs
Fixes:                  f707cc00ed12 ("lro: move pkt rejection checks to leafs to avoid queueing")
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D56420
DeltaFile
+12-3sys/netinet/tcp_lro.c
+12-31 files

HardenedBSD/src 04b994dsys/net bpf.c

bpf: fix handling the read timeout on ppc64

On platforms other than amd64, BIOCSRTIMEOUT is equal to
BIOCSRTIMEOUT32. Therefore, running the COMPAT_FREEBSD32 code
basically clears tv_usec on big endian platforms. When tcpdump is
used, the timeout requested is 100ms, which gets cleared to 0 on
ppc64 platforms. This results in tcpdump showing the packets only
when the read buffer is full.
Thanks to kib for guiding me to the correct fix.

Reported by:            ivy
Reviewed by:            adrian, kib
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D56399
DeltaFile
+22-20sys/net/bpf.c
+22-201 files

HardenedBSD/src 92c69c7sys/geom/label g_label.c

glabel(8): Fix debug message for already existing labels

Remove the duplicate (incorrect) name.

PR:             294542
Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56400
DeltaFile
+2-2sys/geom/label/g_label.c
+2-21 files

HardenedBSD/src 454165dsys/dev/thunderbolt nhi_pci.c nhi.c, tests/sys/netinet ip_mroute.py

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+140-13tests/sys/netinet/ip_mroute.py
+5-116sys/dev/thunderbolt/nhi_pci.c
+26-24usr.bin/du/du.c
+3-46sys/dev/thunderbolt/nhi.c
+19-1usr.bin/du/tests/du_test.sh
+0-18sys/dev/thunderbolt/nhi_var.h
+193-2188 files not shown
+213-23814 files

HardenedBSD/src 18454bcsys/dev/thunderbolt nhi_pci.c nhi.c, tests/sys/netinet ip_mroute.py

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+140-13tests/sys/netinet/ip_mroute.py
+5-116sys/dev/thunderbolt/nhi_pci.c
+26-24usr.bin/du/du.c
+3-46sys/dev/thunderbolt/nhi.c
+19-1usr.bin/du/tests/du_test.sh
+0-18sys/dev/thunderbolt/nhi_var.h
+193-2188 files not shown
+213-23814 files

HardenedBSD/src b6b0afesys/vm vm_swapout.c

vm_swapout: Remove a special case from vm_swapout_map_deactivate_pages()

John points out that this probably should have been removed in commit
472888018ce, which removed a special case where we'd set desired=0 if
the target process has P_INMEM clear.  It's not obvious to me that the
desired=0 case can't arise by setting an RSS limit to 0, but I'm not
sure why we'd try to go the extra mile in that case anyway.

Reported by:    jhb
Reviewed by:    kib
MFC after:      2 weeks
Fixes:          472888018ce1 ("proc: Remove kernel stack swapping support, part 6")
Differential Revision:  https://reviews.freebsd.org/D56140
DeltaFile
+0-13sys/vm/vm_swapout.c
+0-131 files

HardenedBSD/src 0c09c65tests/sys/fs/fusefs rename.cc

tests/fusefs: appease gcc -Wcast-qual

Fix gcc build error.

Reviewed by:    asomers, kib
Fixes:  7e68af7ce2c1 ("fusefs: redo vnode attribute locking")
Differential Revision:  https://reviews.freebsd.org/D56370
DeltaFile
+2-2tests/sys/fs/fusefs/rename.cc
+2-21 files

HardenedBSD/src 1dddb58sys/conf ldscript.arm64

arm64: Define the .iplt section placement.

Ensure that the .plt and .ipld sections are in the executable memory segment.

MFC after:      1 week
Reviewed by:    andrew
Differential Revision: https://reviews.freebsd.org/D56403
DeltaFile
+6-1sys/conf/ldscript.arm64
+6-11 files

HardenedBSD/src 18b7115sys/netinet ip_mroute.c, sys/netinet6 ip6_mroute.c

ip_mroute: Fix a lock leak in X_ip_mforward()

If a FIB does not have a router configured, X_ip_mforward() would leak a
lock.  Plug the leak.

The IPv6 counterpart did not have such a check.  It wouldn't send an
upcall to a non-existent router anyway due to the router_ver check, but
we should verify that a router is present anyway.

Add regression test cases to exercise these code paths.

Reported by:    Claude Opus 4.6
Fixes:          0bb9c2b665d9 ("ip6_mroute: FIBify")
Sponsored by:   Klara, Inc.
Sponsored by:   Stormshield
DeltaFile
+140-13tests/sys/netinet/ip_mroute.py
+3-1sys/netinet/ip_mroute.c
+4-0sys/netinet6/ip6_mroute.c
+147-143 files

HardenedBSD/src e99b3f5usr.bin/du/tests du_test.sh

du: Fix t_flag test case

MFC after:      1 week
Fixes:          3e5550d25c6d ("du: Add regression tests")
Sponsored by:   Klara, Inc.
DeltaFile
+1-1usr.bin/du/tests/du_test.sh
+1-11 files

HardenedBSD/src 6c18dd3usr.bin/du du.c du.1, usr.bin/du/tests du_test.sh

du: Complete libxo transition

* Use xo_warn() / xo_err() instead of warn() / err().

* Add a test case for the POSIX-mandated stdout error check.

* While here, don't assume the size of off_t, address some style issues,
  and broaden the use of bool instead of int.

* Reorder SEE ALSO section.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D56402
DeltaFile
+26-24usr.bin/du/du.c
+18-0usr.bin/du/tests/du_test.sh
+2-2usr.bin/du/du.1
+46-263 files

HardenedBSD/src 52d2fc7sys/compat/linuxkpi/common/include/linux kfifo.h

linuxkpi: Fix an off-by-one error in the kfifo implementation

"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.

Note that no consumers of the code are currently connected to the kernel
build.

Reported by:    Stanislav Fort <stanislav.fort at aisle.com>
Reviewed by:    bz, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56371
DeltaFile
+2-2sys/compat/linuxkpi/common/include/linux/kfifo.h
+2-21 files

HardenedBSD/src bb36c45sys/dev/pci pcireg.h, sys/dev/thunderbolt nhi_pci.c nhi.c

thunderbolt: Support generic USB4 NHIs

Check a PCI device's class, subclass, and progif to figure out if it is
a USB4 NHI. nhi_identifiers is completely removed as only these generic
USB4 NHIs are supported anyway, and all remnants of ICM-supporting code
are removed too. All devices now use the HCM.

PR:             290827
Reviewed by:    jhb, ngie
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52861
DeltaFile
+5-116sys/dev/thunderbolt/nhi_pci.c
+3-46sys/dev/thunderbolt/nhi.c
+0-18sys/dev/thunderbolt/nhi_var.h
+0-12sys/dev/thunderbolt/tb_pcib.c
+1-0sys/dev/pci/pcireg.h
+9-1925 files

HardenedBSD/src 2227904. UPDATING, libexec/rc/rc.d NETWORKING

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+3-3usr.bin/sockstat/sockstat.1
+6-0UPDATING
+4-0sys/sys/time.h
+1-1libexec/rc/rc.d/NETWORKING
+14-44 files

HardenedBSD/src 095f7a4. UPDATING, libexec/rc/rc.d NETWORKING

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+3-3usr.bin/sockstat/sockstat.1
+6-0UPDATING
+4-0sys/sys/time.h
+1-1libexec/rc/rc.d/NETWORKING
+14-44 files

HardenedBSD/src 4f752balib/libc/tests/string strrchr_test.c Makefile, usr.bin/stat/tests stat_test.sh readlink_test.sh

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+156-0lib/libc/tests/string/strrchr_test.c
+13-12usr.bin/stat/tests/stat_test.sh
+6-3usr.bin/stat/tests/readlink_test.sh
+2-0lib/libc/tests/string/Makefile
+1-0usr.sbin/daemon/daemon.c
+178-155 files

HardenedBSD/src e4f02a7lib/libc/tests/string strrchr_test.c Makefile

libc/tests/string: add a more comprehensive unit test for strrchr()

The unit tests are patterned after those for memrchr().
This catches the issue found in 293915.

PR:             293915
Reviewed by:    strajabot
Reported by:    safonov.paul at gmail.com
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56037

(cherry picked from commit 8b5d77bbcbd98e684226950be1c779e108059d8d)
DeltaFile
+156-0lib/libc/tests/string/strrchr_test.c
+2-0lib/libc/tests/string/Makefile
+158-02 files

HardenedBSD/src a6bd704usr.bin/sockstat sockstat.1

sockstat: Unbreak SEE ALSO section

MFC after:      1 week
Fixes:          7b35b4d19630 ("sockstat: add libxo support")
DeltaFile
+3-3usr.bin/sockstat/sockstat.1
+3-31 files

HardenedBSD/src 47a9af4. UPDATING, libexec/rc/rc.d NETWORKING

rc.d/NETWORKING: remove the NETWORK alias

NETWORKING is the documented placeholder, while
/etc/rc.d/NETWORKING still provides the legacy alias
NETWORK.

The NETWORKING script was originally introduced to avoid
conflicts with NetBSD's lowercase network script on
case-insensitive file systems.  The NETWORK alias was
retained for compatibility with older scripts.

Following the discussion in PR 293652, remove the legacy
NETWORK alias from 16-CURRENT.  Keeping both names adds
more confusion than value now that NETWORKING is the
documented placeholder and current base system and ports
tree uses are already clean.

Add an UPDATING entry to note that local RC scripts using
REQUIRE: NETWORK should be migrated to REQUIRE: NETWORKING.

    [5 lines not shown]
DeltaFile
+6-0UPDATING
+1-1libexec/rc/rc.d/NETWORKING
+7-12 files

HardenedBSD/src 5aa751cusr.sbin/daemon daemon.c

daemon(8): Add "--output-file -o" to list of options enabling supervision mode

This is the small internal doc fix from https://reviews.freebsd.org/D46313

Reviewed by:    michaelo
Approved by:    (blanket; comment fix)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55325

(cherry picked from commit e9a69948a8837601d71e556550a272ca85c03e48)
DeltaFile
+1-0usr.sbin/daemon/daemon.c
+1-01 files

HardenedBSD/src 00dccc3sys/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
DeltaFile
+4-0sys/sys/time.h
+4-01 files

HardenedBSD/src 94d4be9usr.bin/stat/tests stat_test.sh

stat: Nits in stat tests

* Use ourselves as test file instead of /COPYRIGHT, which may or may not
  be present in the test environment.

* atf-check understands \n in strings, use it.

* Some file systems don't like creating small holes, so create large ones
  instead.  This means we need two variables: ps (page size) is the
  minimum size of a data region and the alignment for a hole, while hs
  (hole size) is the minimum size of the holes we create.  This makes no
  difference on FreeBSD but makes it easier to port the test to other
  platforms.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56304

(cherry picked from commit 8cbd3949297d56e3960dcde73bd7e2277ac4bee8)
DeltaFile
+13-12usr.bin/stat/tests/stat_test.sh
+13-121 files

HardenedBSD/src 9d89e57usr.bin/stat/tests readlink_test.sh

stat: Nits in readlink tests

* The f_flag test may fail if a component of the full path to the
  temporary directory is a symbolic link.

* The n_flag test had an empty head; give it a description.

* Use consistent quoting.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56293

(cherry picked from commit 1c793e7cbe2ecded388fd51fb20274891620a6f4)
DeltaFile
+6-3usr.bin/stat/tests/readlink_test.sh
+6-31 files