HardenedBSD/src 63de194contrib/nvi/common extern.h, contrib/nvi/ex extern.h

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+0-444usr.bin/vi/extern.h
+145-0usr.bin/vi/vi_extern.h
+145-0contrib/nvi/vi/extern.h
+131-0usr.bin/vi/common_extern.h
+131-0contrib/nvi/common/extern.h
+131-0contrib/nvi/ex/extern.h
+683-44437 files not shown
+1,326-63143 files

HardenedBSD/src 69c64e3tools/tools/git git-arc.1

git-arc.1: Fix patch options

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55228
DeltaFile
+2-3tools/tools/git/git-arc.1
+2-31 files

HardenedBSD/src 3785773sys/dev/usb/net if_ure.c

ure: improve receive checksum offloading

Let the receive checksum offload for TCP/IPv6 and UDP/IPv6 be
controlled by ifconfig rxcsum6 and not by ifconfig rxcsum.
While there, make the code more compact and improve stlye.9
conformity.

Reviewed by:            Timo Völker
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D55188
DeltaFile
+15-23sys/dev/usb/net/if_ure.c
+15-231 files

HardenedBSD/src 950dedcsys/net pfvar.h

pf: remove unused variable from pf_test_ctx

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+0-1sys/net/pfvar.h
+0-11 files

HardenedBSD/src 1ea0721sys/dev/virtio/gpu virtio_gpu.c

vtgpu: Support virtio gpu on Parallels Desktop

The Parallels Desktop Virtio GPU implementation doesn't handle
enqueuing the VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING request and
memory list together.

Work around this by splitting them before sending them to be enqueued.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55147
DeltaFile
+38-13sys/dev/virtio/gpu/virtio_gpu.c
+38-131 files

HardenedBSD/src 7e5f4bbsys/kern kern_dump.c

kernel dump: dumpsys_gen_pa_next(): Fix "no more chunks" condition detection

In the (improbable) cases where either:
- All entries in dump_map[] are used, so there is no guard entry filled with zeros.
- Some dump region has size 0.
We would respectively access dump_map[] out-of-bounds or omit further
dump regions when iterating.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-1sys/kern/kern_dump.c
+2-11 files

HardenedBSD/src 1224347sys/arm64/arm64 copyinout.S copyinout_ifunc.c, sys/conf files.arm64

arm64: Add MOPS implementations of copyin/copyout

Reimplement copyin() & copyout() as ifuncs.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54947
DeltaFile
+52-6sys/arm64/arm64/copyinout.S
+50-0sys/arm64/arm64/copyinout_ifunc.c
+1-0sys/conf/files.arm64
+103-63 files

HardenedBSD/src 18af5a1sys/arm64/arm64 trap.c

arm64: Enable MOPS usage in the kernel

Support handling kernel-side MOE exceptions.

Reported by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54943
DeltaFile
+63-60sys/arm64/arm64/trap.c
+63-601 files

HardenedBSD/src 7d7295dsys/arm64/arm64 pmap.c support.S, sys/arm64/include machdep.h

arm64: Add MOPS implementation of pagezero()

Reimplement pagezero() as ifunc. As pagezero() is only used in pmap.c,
move ifunc to that file.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54946
DeltaFile
+22-0sys/arm64/arm64/pmap.c
+12-0sys/arm64/arm64/support.S
+0-10sys/arm64/arm64/machdep.c
+0-1sys/arm64/include/machdep.h
+34-114 files

HardenedBSD/src 2ccbf06sys/arm64/arm64 machdep.c memcpy.S, sys/arm64/include cpu.h

arm64: Add MOPS implementations of memset(), memcpy() and memmove()

Enable the use of MOPS implementations of memset, memcpy and memmove within
the kernel. Fix pre-ifunc resolution uses of these functions.

Reported by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55051
DeltaFile
+36-2sys/arm64/arm64/machdep.c
+20-4sys/arm64/arm64/memcpy.S
+10-2sys/arm64/arm64/memset.S
+5-5sys/arm64/arm64/pmap.c
+6-1sys/arm64/include/cpu.h
+3-2sys/arm64/arm64/identcpu.c
+80-161 files not shown
+81-177 files

HardenedBSD/src 083f8f3sys/contrib/dev/athk/ath10k ce.c

ath10k: update Atheros/QCA's ath10k driver

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
05f7e89ab9731565d8a62e3b5d1ec206485eeb0b ( tag: v6.19 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+8-8sys/contrib/dev/athk/ath10k/ce.c
+8-81 files

HardenedBSD/src 4c23a98sys/kern subr_asan.c

asan: Use memset_early() to fill shadow memory

__builtin_memset() calls are replaced with calls to memset(), but that
can't be used before ifunc relocations are processed if the
implementation is selected at boot time.  Meanwhile, the sanitizer may
emit calls to __asan_set_shadow_*() as soon as locore jumps into C code,
before ifuncs are selected.

Just unconditionally use memset_early() to work around this.

Reported by:    andrew
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55079
DeltaFile
+2-2sys/kern/subr_asan.c
+2-21 files

HardenedBSD/src a485399sys/netinet tcp_syncache.c, sys/sys mbuf.h

tcp: restrict flowtype copying to specific RSS TCP types

Reviewed by:    gallatin, tuexen
Differential Revision:  https://reviews.freebsd.org/D55196
DeltaFile
+2-2sys/netinet/tcp_syncache.c
+4-0sys/sys/mbuf.h
+6-22 files

HardenedBSD/src 91a3131. ce.c

ath10k: update Atheros/QCA's ath10k driver

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
05f7e89ab9731565d8a62e3b5d1ec206485eeb0b ( tag: v6.19 ).

Sponsored by:   The FreeBSD Foundation
DeltaFile
+8-8ce.c
+8-81 files

HardenedBSD/src 212272aetc/mtree BSD.usr.dist

mtree: stop creating /usr/share/doc/ncurses

In base 68ad2b0d7af2a the ncurses html documentation was removed, and
entries added to ObsoleteFiles.inc to get rid of /usr/share/doc/ncurses,
but the directory was still being re-created via BSD.usr.dist. Remove it
from there too.

Fixes:          68ad2b0d7af2a
MFC after:      1 month
DeltaFile
+0-2etc/mtree/BSD.usr.dist
+0-21 files

HardenedBSD/src 36ec2b1bin/pwd Makefile, bin/pwd/tests pwd_test.sh Makefile

pwd: Add tests

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55153
DeltaFile
+73-0bin/pwd/tests/pwd_test.sh
+6-2bin/pwd/Makefile
+4-0bin/pwd/tests/Makefile
+2-0etc/mtree/BSD.tests.dist
+85-24 files

HardenedBSD/src 2df923cbin/pwd pwd.c pwd.1

pwd: Clean up and adopt POSIX semantics

According to POSIX, the default should be -L.  Based on code history,
whoever first wrote BSD pwd(1) could not figure out how to implement
-L and therefore made -P the default (and only) option. Support for -L
was later added, but the default was never changed.

Clean up the code, make -L the default, and rewrite getcwd_logical() to
reject paths that contain dot or dot-dot, as required by POSIX.

MFC after:      1 week
Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D55146
DeltaFile
+52-47bin/pwd/pwd.c
+2-2bin/pwd/pwd.1
+54-492 files

HardenedBSD/src c92f6eeusr.bin/diff diff.c

diff: Bump version number

MFC after:      1 week
Sponsored by:   Klara, Inc.

(cherry picked from commit 40134060f6583486ad8ab303140fa73960d3de3d)
DeltaFile
+1-1usr.bin/diff/diff.c
+1-11 files

HardenedBSD/src cbd1600usr.bin/diff diffreg.c

diff: Report I/O errors in Stone algorithm

In the legacy Stone algorithm, we do a first pass over the files to
check if they're identical before we start diffing them.  That code
would correctly set the exit status if an I/O error was encountered,
but would not emit an error message.  Do so.

PR:             292198
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj
Differential Revision:  https://reviews.freebsd.org/D55125

(cherry picked from commit f8c12e6e3874cdd353fb16785da6f4e7eb134cd9)
DeltaFile
+7-3usr.bin/diff/diffreg.c
+7-31 files

HardenedBSD/src 2a54bfausr.bin/diff/tests diff_test.sh

diff: Correctly declare tests

Sponsored by:   Klara, Inc.
Fixes:          5fc739eb5949 ("diff: Fix integer overflows in Stone algorithm")
Fixes:          270492602b9b ("diff: Add test case for pagination resource leak")
Fixes:          590126789c84 ("diff: Don't compare a file or directory to itself")

(cherry picked from commit 157d6664aeb815db3b758bd3038fd1512a0f4e2c)
DeltaFile
+4-1usr.bin/diff/tests/diff_test.sh
+4-11 files

HardenedBSD/src 5fdcdf4usr.bin/diff diffdir.c diffreg.c, usr.bin/diff/tests diff_test.sh

diff: Don't compare a file or directory to itself

While here, stop abusing struct dirent for something we don't even need
to store.

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

(cherry picked from commit 590126789c841d80655869bc075c8980c173dd1c)

diff: Fix build

rc must be defined first.

Fixes:          590126789c84
MFC after:      1 week

    [3 lines not shown]
DeltaFile
+19-0usr.bin/diff/tests/diff_test.sh
+8-8usr.bin/diff/diffdir.c
+3-0usr.bin/diff/diffreg.c
+30-83 files

HardenedBSD/src 07f25fausr.bin/diff diffreg_new.c

diff: Print an error message on I/O error

If an error occurs while atomizing either file, immediately print an
error message using the error code returned by the atomizer, and set
the error bit in the exit status.

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

(cherry picked from commit 55f160fb07eaee977c89bdee7bdd83f4d21f5adf)
DeltaFile
+11-2usr.bin/diff/diffreg_new.c
+11-21 files

HardenedBSD/src e87b922usr.bin/diff pr.c pr.h

diff: Fix pagination leak

* Drop an unnecessary variable and rename pidfd to procd.

* Rewinding stdout serves no purpose, so stop doing it.

* Don't bother freeing memory or setting the global status right
  before erroring out.

* Error out if dup(2) or dup2(2) fail.

* In the unlikely case that our pipe is equal to stdout, we need to
  record that information so we don't close it when cleaning up.

* Don't bother closing a descriptor before dup2(2)ing to it.

* Don't forget to close the the process descriptor after reaping the
  child process.


    [7 lines not shown]
DeltaFile
+10-12usr.bin/diff/pr.c
+1-1usr.bin/diff/pr.h
+11-132 files

HardenedBSD/src a0a37c2usr.bin/diff/tests diff_test.sh

diff: Add test case for pagination resource leak

The pagination code leaks either processes or descriptors or both,
depending on the exact version of the code you have.  Add a test case
which exercises this leak to facilitate fixing it.

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

(cherry picked from commit 270492602b9bd8b8fce4f021f055804978bf3f23)
DeltaFile
+22-0usr.bin/diff/tests/diff_test.sh
+22-01 files

HardenedBSD/src 4a30735usr.bin/diff diffreg.c, usr.bin/diff/tests diff_test.sh

diff: Fix integer overflows in Stone algorithm

Fix integer overflows that may occur when the context window is very
large and add tests to exercise those conditions.

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

(cherry picked from commit 5fc739eb5949620da911db2f87ca8faedc549d3a)
DeltaFile
+33-0usr.bin/diff/tests/diff_test.sh
+21-11usr.bin/diff/diffreg.c
+54-112 files

HardenedBSD/src b97396bcontrib/libdiff/include diff_main.h, contrib/libdiff/lib diff_atomize_text.c

libdiff: Simplify truncation detection

* Adjust the comment to reflect the fact that SIGBUS can occur not only
  if the file is truncated, but also if an I/O error occurs while paging
  in any part of it.

* Instead of setting a flag, just return EIO.

* Adjust the unit test accordingly.

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

(cherry picked from commit a689bfa4e25af8307709dc12f75b0e02a65abf18)
DeltaFile
+7-5contrib/libdiff/lib/diff_atomize_text.c
+0-4usr.bin/diff/diffreg_new.c
+1-2lib/libdiff/tests/libdiff_test.c
+0-1contrib/libdiff/include/diff_main.h
+8-124 files

HardenedBSD/src 47fb518sys/netpfil/ipfilter/netinet fil.c

ipfilter: Interface name must not extend beyond end of buffer

sifpidx (an interface name) cannot extend beyond the end of the
fr_names buffer.

We do the validation for fr_sifpidx here because it is a union that
contains an offset only when fr_sifpidx points to an interface name,
an offset into fr_names. The union is  an offset into fr_names in this
case only.

interr_tbl now becomes a static variable outside a function to facilitate
its use by two functions within fil.c

Note that sifpidx is only used in ipf_sync() which implments ipf -y.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
MFC after:      1 week
DeltaFile
+21-2sys/netpfil/ipfilter/netinet/fil.c
+21-21 files

HardenedBSD/src 93075bdsbin/ifconfig ifconfig_netlink.c, share/man/man9 ifnet.9

net: Remove the IFF_RENAMING flag

This used to be needed when interface renames were broadcast using the
ifnet_departure_event eventhandler, but since commit 349fcf079ca3
("net: add ifnet_rename_event EVENTHANDLER(9) for interface renaming"),
it has no purpose.  Remove it.

Reviewed by:    pouria, zlei
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55171
DeltaFile
+0-10sys/net/if.c
+0-3share/man/man9/ifnet.9
+0-3sys/net/if_lagg.c
+0-3sys/net/if_vlan.c
+0-2sys/net/if_vxlan.c
+1-1sbin/ifconfig/ifconfig_netlink.c
+1-224 files not shown
+1-2810 files

HardenedBSD/src 9df6a7fsys/netinet ip_mroute.h ip_var.h, sys/netinet6 ip6_mroute.h ip6_var.h

ip_mroute: Try to make function pointer declarations more consistent

The ip_mroute and ip6_mroute modules hook into the network stack via
several function pointers.  Declarations for these pointers are
scattered around several headers.  Put them all in the same place,
ip(6)_mroute.h.

No functional change intended.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55058
DeltaFile
+18-3sys/netinet/ip_mroute.h
+14-0sys/netinet6/ip6_mroute.h
+0-10sys/netinet/ip_var.h
+0-2sys/netinet6/ip6_var.h
+1-0sys/netinet/ip_output.c
+1-0sys/netinet6/ip6_input.c
+34-155 files not shown
+39-1511 files

HardenedBSD/src d8f7a7bsys/netinet6 ip6_mroute.c

ip6_mroute: Deindent some code in ip6_mdq()

Deal with the mifi >= nummifs case early so that we can de-indent the
rest of the code.  This also ensures that the debug log (compiled out by
default) doesn't perform an out-of-bounds access.

Remove a bogus NULL test in an inner loop while here.

No functional change intended.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55059
DeltaFile
+68-66sys/netinet6/ip6_mroute.c
+68-661 files