HardenedBSD/src cb0c532contrib/less screen.c, sys/kern vfs_subr.c

Merge remote-tracking branch 'internal/freebsd/13-stable/main' into hardened/13-stable/master

Conflicts:
        bin/cat/cat.c
        lib/libc/gen/auxv.3
        libexec/rc/rc.d/archdep
        share/man/man5/src.conf.5
        sys/amd64/amd64/elf_machdep.c
        sys/amd64/cloudabi64/cloudabi64_sysvec.c
        sys/amd64/linux/linux_sysvec.c
        sys/amd64/linux32/linux32_sysvec.c
        sys/arm/arm/elf_machdep.c
        sys/arm64/linux/linux_sysvec.c
        sys/compat/ia32/ia32_sysvec.c
        sys/i386/cloudabi32/cloudabi32_sysvec.c
        sys/i386/linux/imgact_linux.c
        sys/i386/linux/linux_sysvec.c
        sys/kern/imgact_aout.c
        sys/kern/kern_module.c

    [22 lines not shown]
DeltaFile
+175-44sys/vm/vm_map.c
+97-38sys/kern/vfs_subr.c
+64-0tests/sys/vm/stack/stack_dlopen_exec_test.c
+57-0tests/sys/vm/stack/stack_mprotect_exec_test.c
+42-11contrib/less/screen.c
+51-0tests/sys/vm/soxstack/soxstack.c
+486-9331,889 files not shown
+1,170-49,85331,895 files

HardenedBSD/src 3d497e1lib/libc/gen wordexp.c, lib/libdevdctl event.cc event_factory.cc

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in main:
(cherry picked from commit 1d386b48a555)
DeltaFile
+0-4lib/msun/ld80/e_powl.c
+0-3lib/libdevdctl/event.cc
+0-3lib/libdevdctl/event_factory.cc
+0-3lib/libc/gen/wordexp.c
+0-3lib/libdevdctl/exception.cc
+0-3lib/msun/i387/e_remainderl.S
+0-193,367 files not shown
+0-6,7253,373 files

HardenedBSD/src acf3d6esys/arm64/arm64 pl031_rtc.c, sys/compat/linux linux_socket.c

Merge remote-tracking branch 'internal/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        tools/build/options/WITH_OFED_EXTRA (deleted)
        usr.sbin/rpc.yppasswdd/Makefile (unresolved)
DeltaFile
+697-0sys/dev/virtio/gpu/virtio_gpu.c
+454-0sys/dev/virtio/gpu/virtio_gpu.h
+153-0sys/arm64/arm64/pl031_rtc.c
+80-52sys/compat/linux/linux_socket.c
+107-0tools/build/freebsd-yeet.pl
+87-11sys/dev/ixl/ixl_pf_main.c
+1,578-6331,042 files not shown
+2,188-48,40531,048 files

HardenedBSD/src 2226d61sys/arm64/arm64 pl031_rtc.c, sys/compat/linux linux_socket.c

Merge remote-tracking branch 'internal/freebsd/current/main' into hardened/current/master

Conflicts:
        bin/cat/cat.c (unresolved)
        lib/csu/aarch64/crt1_c.c (unresolved)
        lib/csu/amd64/crt1_c.c (unresolved)
        lib/csu/i386/crt1_c.c (unresolved)
        lib/csu/powerpc64/crt1_c.c (unresolved)
        lib/csu/powerpc64/reloc.c (unresolved)
        lib/csu/riscv/crt1_c.c (unresolved)
        lib/libc/gen/auxv.3 (unresolved)
        lib/libcasper/services/cap_net/cap_net.3 (unresolved)
        sys/amd64/amd64/elf_machdep.c (unresolved)
        sys/amd64/include/sgxreg.h (deleted)
        sys/amd64/linux/linux_sysvec.c (unresolved)
        sys/amd64/linux32/linux32_sysvec.c (unresolved)
        sys/amd64/sgx/sgx.c (deleted)
        sys/amd64/sgx/sgx_linux.c (deleted)
        sys/amd64/sgx/sgxvar.h (deleted)

    [29 lines not shown]
DeltaFile
+697-0sys/dev/virtio/gpu/virtio_gpu.c
+454-0sys/dev/virtio/gpu/virtio_gpu.h
+153-0sys/arm64/arm64/pl031_rtc.c
+80-52sys/compat/linux/linux_socket.c
+107-0tools/build/freebsd-yeet.pl
+87-11sys/dev/ixl/ixl_pf_main.c
+1,578-6331,044 files not shown
+2,304-48,37531,050 files

HardenedBSD/src 1d386b4lib/libc/arm/gen _setjmp.S, lib/libc/gen wordexp.c

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
DeltaFile
+0-4lib/msun/ld80/e_powl.c
+0-3lib/libc/powerpc/gen/_ctx_start.S
+0-3lib/libc/gen/wordexp.c
+0-3lib/libc/arm/gen/_setjmp.S
+0-3lib/libc/rpc/clnt_bcast.c
+0-3tools/regression/environ/timings.c
+0-193,287 files not shown
+0-6,5753,293 files

HardenedBSD/src 31367a1contrib/sqlite3 sqlite3.c, share/colldef_unicode zh_CN.UTF-8.src

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        share/man/man5/src.conf.5 (unresolved)
DeltaFile
+40,646-40,658share/colldef_unicode/zh_CN.UTF-8.src
+46,300-0sys/contrib/dev/rtw88/rtw8822c_table.c
+0-27,824sys/contrib/openzfs/module/zstd/lib/zstd.c
+22,204-0sys/contrib/dev/rtw88/rtw8822b_table.c
+9,441-436sys/contrib/zlib/crc32.h
+5,931-3,922contrib/sqlite3/sqlite3.c
+124,522-72,84014,231 files not shown
+826,315-442,38114,237 files

HardenedBSD/src 4ccbf0eusr.bin/ar write.c acpyacc.y

Merge remote-tracking branch 'freebsd/stable/13' into hardened/13-stable/master
DeltaFile
+34-79usr.bin/ar/write.c
+25-31usr.bin/ar/acpyacc.y
+16-36usr.bin/ar/ar.c
+15-35usr.bin/ar/read.c
+5-13usr.bin/ar/ar.h
+2-2usr.bin/ar/util.c
+97-1966 files

HardenedBSD/src b6fb6causr.bin/ar write.c acpyacc.y

Merge remote-tracking branch 'freebsd/stable/12' into hardened/12-stable/master
DeltaFile
+34-79usr.bin/ar/write.c
+25-31usr.bin/ar/acpyacc.y
+16-36usr.bin/ar/ar.c
+15-35usr.bin/ar/read.c
+5-13usr.bin/ar/ar.h
+2-2usr.bin/ar/util.c
+97-1966 files

HardenedBSD/src 21a6c9busr.bin/ar read.c acpyacc.y

ar: Avoid overwriting the stdout file stream pointer

This doesn't work with musl, which defines stdout as FILE * const.
Instead, explicitly pass the desired output stream to ar_read_archive().

No functional change intended.

Reviewed by:    emaste
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D34064

(cherry picked from commit 41e6398f9bc1bba4ed872118e742096d692fdfec)
DeltaFile
+9-9usr.bin/ar/read.c
+6-8usr.bin/ar/acpyacc.y
+1-1usr.bin/ar/ar.h
+1-1usr.bin/ar/ar.c
+17-194 files

HardenedBSD/src 6367fd2usr.bin/ar write.c ar.c

ar: diff reduction against ELF Tool Chain

- Drop exit status from bsdar_errc.  ELF Tool Chain always returns
  EXIT_FAILURE in bsdar_errc.

- Remove ar_mode_* wrappers and call ar_read_archive / ar_write_archive
  directly.

Obtained from:  ELF Tool Chain
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D31496

(cherry picked from commit d20e9e02db3dde383c3de1ce8cec3a8c35b3eee6)
(cherry picked from commit c5bf58add0d523fc6e6546f3fc10d0c8b972e8e7)
(cherry picked from commit 086f09087713e3af0a28d296a2372071b72211ef)
(cherry picked from commit 57aaefdceccdd590f81af4b274c7a3ee61ae62f1)
(cherry picked from commit 866c807472619371adcb2a0409a9287748a52654)
(cherry picked from commit d8ffb451194ec2d91a549e0682370f312d0ecdd3)
DeltaFile
+34-79usr.bin/ar/write.c
+16-36usr.bin/ar/ar.c
+22-26usr.bin/ar/acpyacc.y
+7-27usr.bin/ar/read.c
+5-13usr.bin/ar/ar.h
+2-2usr.bin/ar/util.c
+86-1836 files

HardenedBSD/src 4cd49edusr.bin/ar read.c acpyacc.y

ar: Avoid overwriting the stdout file stream pointer

This doesn't work with musl, which defines stdout as FILE * const.
Instead, explicitly pass the desired output stream to ar_read_archive().

No functional change intended.

Reviewed by:    emaste
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D34064

(cherry picked from commit 41e6398f9bc1bba4ed872118e742096d692fdfec)
DeltaFile
+9-9usr.bin/ar/read.c
+6-8usr.bin/ar/acpyacc.y
+1-1usr.bin/ar/ar.c
+1-1usr.bin/ar/ar.h
+17-194 files

HardenedBSD/src d8ffb45usr.bin/ar write.c ar.c

ar: diff reduction against ELF Tool Chain

- Drop exit status from bsdar_errc.  ELF Tool Chain always returns
  EXIT_FAILURE in bsdar_errc.

- Remove ar_mode_* wrappers and call ar_read_archive / ar_write_archive
  directly.

Obtained from:  ELF Tool Chain
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D31496

(cherry picked from commit d20e9e02db3dde383c3de1ce8cec3a8c35b3eee6)
(cherry picked from commit c5bf58add0d523fc6e6546f3fc10d0c8b972e8e7)
(cherry picked from commit 086f09087713e3af0a28d296a2372071b72211ef)
(cherry picked from commit 57aaefdceccdd590f81af4b274c7a3ee61ae62f1)
(cherry picked from commit 866c807472619371adcb2a0409a9287748a52654)
DeltaFile
+34-79usr.bin/ar/write.c
+16-36usr.bin/ar/ar.c
+22-26usr.bin/ar/acpyacc.y
+7-27usr.bin/ar/read.c
+5-13usr.bin/ar/ar.h
+2-2usr.bin/ar/util.c
+86-1836 files

HardenedBSD/src a73ac5econtrib/bsddialog bsddialog.c bsddialog.1, contrib/bsddialog/lib menubox.c bsddialog.3

Merge remote-tracking branch 'origin/freebsd/current/main' into hardened/current/master

Conflicts:
        sys/i386/i386/elf_machdep.c (unresolved)
        usr.sbin/bsdinstall/distextract/distextract.c (unresolved)
        usr.sbin/bsdinstall/scripts/fetchmissingdists (unresolved)
DeltaFile
+813-755contrib/bsddialog/bsddialog.c
+373-722contrib/bsddialog/lib/menubox.c
+632-179contrib/bsddialog/lib/bsddialog.3
+471-280contrib/bsddialog/lib/lib_util.c
+557-33contrib/bsddialog/bsddialog.1
+261-310contrib/bsddialog/lib/barbox.c
+3,107-2,279124 files not shown
+5,211-6,794130 files

HardenedBSD/src 41e6398usr.bin/ar read.c acpyacc.y

ar: Avoid overwriting the stdout file stream pointer

This doesn't work with musl, which defines stdout as FILE * const.
Instead, explicitly pass the desired output stream to ar_read_archive().

No functional change intended.

Reviewed by:    emaste
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D34064
DeltaFile
+9-9usr.bin/ar/read.c
+6-8usr.bin/ar/acpyacc.y
+1-1usr.bin/ar/ar.h
+1-1usr.bin/ar/ar.c
+17-194 files

HardenedBSD/src 6a32f4fcontrib/llvm-project/llvm/lib/Analysis/models/inliner saved_model.pbtxt, contrib/sqlite3 sqlite3.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        share/man/man5/src.conf.5 (unresolved)
        usr.sbin/hbsd-update/hbsd-update.conf (unresolved)
DeltaFile
+0-32,634contrib/llvm-project/llvm/lib/Analysis/models/inliner/saved_model.pbtxt
+9,480-9,480lib/libpmc/pmu-events/arch/x86/cascadelakex/cache.json
+10,895-7,688contrib/sqlite3/sqlite3.c
+8,062-8,054lib/libpmc/pmu-events/arch/x86/cascadelakex/memory.json
+7,713-7,713lib/libpmc/pmu-events/arch/x86/cascadelakex/other.json
+0-13,083sys/contrib/octeon-sdk/cvmx-ciu-defs.h
+36,150-78,65213,448 files not shown
+1,006,794-1,015,87713,454 files

HardenedBSD/src c4598b4contrib/elftoolchain/readelf readelf.c, sys/netinet/tcp_stacks bbr.c

Merge remote-tracking branch 'origin/freebsd/13-stable/main' into hardened/13-stable/master
DeltaFile
+23-1contrib/elftoolchain/readelf/readelf.c
+9-5usr.bin/ar/ar.1
+4-4sys/netinet/tcp_stacks/bbr.c
+5-1usr.bin/ar/ar.c
+41-114 files

HardenedBSD/src f32d74acontrib/elftoolchain/readelf readelf.c, usr.bin/ar ar.1 ar.c

Merge remote-tracking branch 'freebsd/stable/12' into hardened/12-stable/master
DeltaFile
+23-1contrib/elftoolchain/readelf/readelf.c
+9-5usr.bin/ar/ar.1
+5-1usr.bin/ar/ar.c
+37-73 files

HardenedBSD/src df89882usr.bin/ar ar.1 ar.c

ar: deprecate -T option

Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR:             260523 [exp-run]
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit edadbb46065d9ee9559140b2522197fcdba57064)
DeltaFile
+9-5usr.bin/ar/ar.1
+5-1usr.bin/ar/ar.c
+14-62 files

HardenedBSD/src 2076973usr.bin/ar ar.1 ar.c

ar: deprecate -T option

Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR:             260523 [exp-run]
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit edadbb46065d9ee9559140b2522197fcdba57064)
DeltaFile
+9-5usr.bin/ar/ar.1
+5-1usr.bin/ar/ar.c
+14-62 files

HardenedBSD/src 56476fbsbin/ipfw main.c, sys/arm64/arm64 pmap.c

Merge branch 'hardened/current/master' into hardened/current/sensitive
DeltaFile
+92-52sys/arm64/arm64/pmap.c
+56-73sys/netinet/tcp_subr.c
+100-16usr.sbin/bhyve/pci_emul.c
+64-51sbin/ipfw/main.c
+15-60sys/kern/uipc_domain.c
+39-20sys/netinet/in_pcb.c
+366-27261 files not shown
+636-68767 files

HardenedBSD/src 34806d2sbin/ipfw main.c, share/mk bsd.cpu.mk bsd.compat.mk

Merge remote-tracking branch 'origin/freebsd/current/main' into hardened/current/master

Conflicts:
        share/mk/bsd.opts.mk (unresolved)
        share/mk/bsd.prog.mk (unresolved)
        share/mk/src.opts.mk (unresolved)
DeltaFile
+100-16usr.sbin/bhyve/pci_emul.c
+64-51sbin/ipfw/main.c
+34-12usr.sbin/bhyve/fwctl.c
+0-44share/mk/bsd.cpu.mk
+0-26share/mk/bsd.compat.mk
+11-14share/mk/src.opts.mk
+209-16314 files not shown
+260-19320 files

HardenedBSD/src 1a0a41busr.bin/ar ar.1 ar.c

ar: accept but ignore 'T' option

In previous versions of BSD ar -T was an alias for -f -- use only the
first 15 characters of archive member names.  In GNU ar and LLVM ar -T
creates a thin archive.

The -f / old BSD ar -T functionality is not particularly useful, and
ignoring -T still results in a usable and compatible (but not thin)
archive.

An exp-run found a few ports invoking ar -T but they all expect thin
archives.  In addition, -T will be used to specify thin archives after
a migration to LLVM-ar.

PR:             260523 [exp-run]
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D33553
DeltaFile
+2-3usr.bin/ar/ar.1
+1-2usr.bin/ar/ar.c
+3-52 files

HardenedBSD/src a5f9692lib/libiscsiutil text.c, sys/net if_llatbl.c

Merge branch 'hardened/current/master' into hardened/current/sensitive
DeltaFile
+333-0lib/libiscsiutil/text.c
+117-60sys/net/route/nhop_ctl.c
+141-0sys/net/route/route_debug.h
+80-8sys/net/if_llatbl.c
+4-72usr.sbin/ctld/discovery.c
+2-61usr.sbin/iscsid/discovery.c
+677-20161 files not shown
+972-38867 files

HardenedBSD/src 4d496f0lib/libiscsiutil text.c, sys/net if_llatbl.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+333-0lib/libiscsiutil/text.c
+117-60sys/net/route/nhop_ctl.c
+141-0sys/net/route/route_debug.h
+80-8sys/net/if_llatbl.c
+4-72usr.sbin/ctld/discovery.c
+2-61usr.sbin/iscsid/discovery.c
+677-20153 files not shown
+940-36459 files

HardenedBSD/src edadbb4usr.bin/ar ar.1 ar.c

ar: deprecate -T option

Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR:             260523 [exp-run]
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+9-5usr.bin/ar/ar.1
+5-1usr.bin/ar/ar.c
+14-62 files

HardenedBSD/src ee0adb2bin/freebsd-version freebsd-version.sh.in, sys/dev/e1000 if_em.c

Merge remote-tracking branch 'origin/freebsd/13-stable/main' into hardened/13-stable/master

Conflicts:
        share/man/man5/src.conf.5 (unresolved)
        share/mk/src.opts.mk (unresolved)
DeltaFile
+45-45sys/dev/e1000/if_em.c
+33-29usr.bin/ar/ar.c
+29-20usr.bin/ar/write.c
+23-13usr.bin/ar/read.c
+26-3bin/freebsd-version/freebsd-version.sh.in
+10-10usr.bin/ar/ar.h
+166-12012 files not shown
+237-17018 files

HardenedBSD/src ca90ca0sys/dev/e1000 if_em.c, usr.bin/ar ar.c write.c

Merge remote-tracking branch 'freebsd/stable/12' into hardened/12-stable/master
DeltaFile
+45-45sys/dev/e1000/if_em.c
+33-29usr.bin/ar/ar.c
+29-20usr.bin/ar/write.c
+23-13usr.bin/ar/read.c
+10-10usr.bin/ar/ar.h
+3-3usr.bin/ar/acpyacc.y
+143-1203 files not shown
+148-1259 files

HardenedBSD/src fb15a9fusr.bin/ar ar.c write.c

ar: provide error exit status upon failure

Previously ar and ranlib returned with exit status 0 (success) in the
case of a missing file or other error.  Update to use error handling
similar to that added by ELF Tool Chain after that project forked
FreeBSD's ar.

PR:             PR257599 [exp-run]
Reported by:    Shawn Webb, gehmehgeh (on HardenedBSD IRC)
Reviewed by:    markj
Obtained from:  elftoolchain
MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D31402

(cherry picked from commit 38911b3c2c7dbb9a097b44856472ebbbedde71fc)
DeltaFile
+33-29usr.bin/ar/ar.c
+29-20usr.bin/ar/write.c
+23-13usr.bin/ar/read.c
+10-10usr.bin/ar/ar.h
+3-3usr.bin/ar/acpyacc.y
+2-2usr.bin/ar/acplex.l
+100-776 files

HardenedBSD/src d711030usr.bin/ar ar.c write.c

ar: provide error exit status upon failure

Previously ar and ranlib returned with exit status 0 (success) in the
case of a missing file or other error.  Update to use error handling
similar to that added by ELF Tool Chain after that project forked
FreeBSD's ar.

PR:             PR257599 [exp-run]
Reported by:    Shawn Webb, gehmehgeh (on HardenedBSD IRC)
Reviewed by:    markj
Obtained from:  elftoolchain
MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D31402

(cherry picked from commit 38911b3c2c7dbb9a097b44856472ebbbedde71fc)
DeltaFile
+33-29usr.bin/ar/ar.c
+29-20usr.bin/ar/write.c
+23-13usr.bin/ar/read.c
+10-10usr.bin/ar/ar.h
+3-3usr.bin/ar/acpyacc.y
+2-2usr.bin/ar/acplex.l
+100-776 files

HardenedBSD/src 97f483fcontrib/one-true-awk/testdir bib funstack.in, share/colldef zh_CN.UTF-8.src ja_JP.UTF-8.src

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        Makefile.inc1 (unresolved)
        libexec/rtld-elf/Makefile (unresolved)
        share/man/man5/src.conf.5 (unresolved)
        targets/pseudo/bootstrap-tools/Makefile (unresolved)
DeltaFile
+0-69,894share/colldef/zh_CN.UTF-8.src
+67,474-0share/colldef_unicode/zh_CN.UTF-8.src
+31,102-0contrib/one-true-awk/testdir/bib
+27,220-0contrib/one-true-awk/testdir/funstack.in
+22,150-0share/colldef_unicode/ja_JP.UTF-8.src
+0-22,135share/colldef/ja_JP.UTF-8.src
+147,946-92,0293,519 files not shown
+532,005-310,5073,525 files