HardenedBSD/src c460873sys/dev/ufshci ufshci_ctrlr.c ufshci_req_queue.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+6-19sys/dev/ufshci/ufshci_ctrlr.c
+8-13sys/dev/ufshci/ufshci_req_queue.c
+3-5sys/dev/ufshci/ufshci_private.h
+4-2sys/dev/ufshci/ufshci_ctrlr_cmd.c
+2-1sys/dev/ufshci/ufshci_dev.c
+2-1sys/dev/ufshci/ufshci_sim.c
+25-416 files

HardenedBSD/src bb7be46sys/dev/ufshci ufshci_ctrlr.c ufshci_req_queue.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+6-19sys/dev/ufshci/ufshci_ctrlr.c
+8-13sys/dev/ufshci/ufshci_req_queue.c
+3-5sys/dev/ufshci/ufshci_private.h
+4-2sys/dev/ufshci/ufshci_ctrlr_cmd.c
+2-1sys/dev/ufshci/ufshci_dev.c
+2-1sys/dev/ufshci/ufshci_sim.c
+25-416 files

HardenedBSD/src 77d4961usr.sbin/periodic/etc/daily 801.trim-zfs

periodic/801.trim-zfs: Fix daily-trim-zfs-flags

This variable was named incorrectly, resulting in any specified flags
being silently ignored.

PR:             292074
MFC after:      3 days
Reported by:    CrazyMihey at Ya.Ru
Fixes:          493908c4b45c (Add a daily zfs trim script)

(cherry picked from commit 68d6abd9714384a41028dc0d5086b4930366bbea)
DeltaFile
+1-1usr.sbin/periodic/etc/daily/801.trim-zfs
+1-11 files

HardenedBSD/src ece6e06sys/dev/ufshci ufshci_ctrlr.c ufshci_req_queue.c

ufshci: Enable admin command retry

Also, This patch fixes an issue where the admin command flag was not
passed through.

Sponsored by:           Samsung Electronic

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54244
DeltaFile
+4-13sys/dev/ufshci/ufshci_ctrlr.c
+3-4sys/dev/ufshci/ufshci_req_queue.c
+2-4sys/dev/ufshci/ufshci_private.h
+4-2sys/dev/ufshci/ufshci_ctrlr_cmd.c
+2-1sys/dev/ufshci/ufshci_sim.c
+2-1sys/dev/ufshci/ufshci_dev.c
+17-256 files

HardenedBSD/src ef2d7ccsys/dev/ufshci ufshci_req_queue.c ufshci_ctrlr.c

ufshci: Fix task management queue num_trackers on failure path

Fix a kernel panic caused by the task management queue using
the transfer request queue’s num_entries value.

Sponsored by:           Samsung Electronic

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54243
DeltaFile
+5-9sys/dev/ufshci/ufshci_req_queue.c
+2-6sys/dev/ufshci/ufshci_ctrlr.c
+1-1sys/dev/ufshci/ufshci_private.h
+8-163 files

HardenedBSD/src 4dc7d09sys/vm vm_object.h

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+3-2sys/vm/vm_object.h
+3-21 files

HardenedBSD/src 7c5cb28sys/vm vm_object.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+3-2sys/vm/vm_object.h
+3-21 files

HardenedBSD/src 8cbc9c0lib/libc/stdlib tsearch.3 Makefile.inc

tdestroy(3) man page

(cherry picked from commit b0d4b059cf8425cbe094f93362a61c56a26d45f3)
DeltaFile
+23-2lib/libc/stdlib/tsearch.3
+2-1lib/libc/stdlib/Makefile.inc
+25-32 files

HardenedBSD/src 6a6f964lib/libc/tests/stdlib tsearch_test.c

tdestroy(3): add tests

(cherry picked from commit 3204c097fd08436805f059c0d7f676d29ee9bb62)
DeltaFile
+65-0lib/libc/tests/stdlib/tsearch_test.c
+65-01 files

HardenedBSD/src 6197518include search.h, lib/libc/stdlib tdestroy.c Makefile.inc

libc: add glibc-compatible tdestroy(3)

(cherry picked from commit b8c99e7d912f0dad84cec80f8c4331646b87a3ec)
DeltaFile
+68-0lib/libc/stdlib/tdestroy.c
+1-0lib/libc/stdlib/Makefile.inc
+1-0include/search.h
+1-0lib/libc/stdlib/Symbol.map
+71-04 files

HardenedBSD/src e5b9182lib/libc/gen uexterr_format.c, sys/sys exterr_cat.h

exterr: in verbose mode, print the source file name

(cherry picked from commit 874cdf6af695c42d561647f7165c99c2d3df0faa)
DeltaFile
+17-4lib/libc/gen/uexterr_format.c
+11-0sys/sys/exterr_cat.h
+28-42 files

HardenedBSD/src 567e77dlib/libc/gen exterr_cat_filenames.h

Add automatically generated file libc/gen/exterr_cat_filenames.h

(cherry picked from commit 5685c07b5a8e4ccc19140eeaa5987a38dca7c668)
DeltaFile
+17-0lib/libc/gen/exterr_cat_filenames.h
+17-01 files

HardenedBSD/src 6c797f5sys/vm vm_mmap.c

vm/vm_mmap.c: inline erronous argument values for extended errors

(cherry picked from commit 2904edaf2f09934142f9f6a6d2886879395145cc)
DeltaFile
+25-18sys/vm/vm_mmap.c
+25-181 files

HardenedBSD/src a26a553lib/libc/stdlib Makefile.inc

libc/stdlib/Makefile: one line for each source file name

(cherry picked from commit 04a664d87607d25d87baf56903090707cc91e2e0)
DeltaFile
+69-13lib/libc/stdlib/Makefile.inc
+69-131 files

HardenedBSD/src ca345aalib/libc/gen uexterr_format.c

exterror: Add EXTERROR_VERBOSE env variable to control verbosity

(cherry picked from commit 42210fe8dcd4684a45e0e4db1b8194e291dc8fda)
DeltaFile
+48-5lib/libc/gen/uexterr_format.c
+48-51 files

HardenedBSD/src 39abebbtools/build make_libc_exterr_cat_filenames.sh

Add a script to auto-generate mapping from exterr category to source file

(cherry picked from commit 3ef25acf3600fb822bdf1487036184b4978d737f)
DeltaFile
+22-0tools/build/make_libc_exterr_cat_filenames.sh
+22-01 files

HardenedBSD/src 39a04a3tests/sys/kern exterr_test.c

exterr_test: loosen the error string pattern

(cherry picked from commit 543c86636f73119fa1dab860f07396df5a1884d4)
DeltaFile
+1-1tests/sys/kern/exterr_test.c
+1-11 files

HardenedBSD/src 12918e9sys/fs/fuse fuse_vfsops.c fuse_device.c, sys/sys exterr_cat.h

fs/fuse: use dedicated category per source file

(cherry picked from commit 54b52f655e0fdaef21c3cde85e8bf030efa7b86e)
DeltaFile
+3-1sys/sys/exterr_cat.h
+1-1sys/fs/fuse/fuse_vfsops.c
+1-1sys/fs/fuse/fuse_device.c
+1-1sys/fs/fuse/fuse_vnops.c
+6-44 files

HardenedBSD/src 2b83f57lib/libc/gen err.3, share/man/man7 environ.7

man pages: provide some description for extended errors

(cherry picked from commit 3088263177da2813dd09364171feadd0e31d1fc3)
DeltaFile
+15-1share/man/man7/environ.7
+16-0lib/libc/gen/err.3
+31-12 files

HardenedBSD/src a3b3ac6share/man/man9 exterror.9

exterror.9: describe formatting of optional arguments

(cherry picked from commit 14bd57d0a78dcd98449597fd3e19749799e36935)
DeltaFile
+10-0share/man/man9/exterror.9
+10-01 files

HardenedBSD/src 4c273b7lib/libc/gen uexterr_format.c

exterror: add support for the format specifiers in the extended error msg

(cherry picked from commit 8bff95f3ce0396ff40b4f7d943ea856ac3f846c3)
DeltaFile
+2-1lib/libc/gen/uexterr_format.c
+2-11 files

HardenedBSD/src 1f5dfc8lib/libc/gen err.c

libc/gen/err.c: remove 'extended error' herald from extended error output

(cherry picked from commit 37ddbbe5535cb6c27b8a026b2f28d64319b9f802)
DeltaFile
+1-1lib/libc/gen/err.c
+1-11 files

HardenedBSD/src 9c92357sys/vm vm_object.h

vm/vm_object.h: clarify the OBJ_ONEMAPPING semantic

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D54459
DeltaFile
+3-2sys/vm/vm_object.h
+3-21 files

HardenedBSD/src b6ffcbdlib/libc/amd64/string stpncpy.S, stand/common gfx_fb.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+41-39stand/efi/loader/framebuffer.c
+3-6lib/libc/amd64/string/stpncpy.S
+6-2stand/common/gfx_fb.c
+50-473 files

HardenedBSD/src 7447692lib/libc/amd64/string stpncpy.S, stand/common gfx_fb.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+41-39stand/efi/loader/framebuffer.c
+3-6lib/libc/amd64/string/stpncpy.S
+6-2stand/common/gfx_fb.c
+50-473 files

HardenedBSD/src 2947e44lib/libc/amd64/string stpncpy.S

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+6-6lib/libc/amd64/string/stpncpy.S
+6-61 files

HardenedBSD/src 9c68745lib/libc/amd64/string stpncpy.S

libc/amd64: fix stpncpy.S again

The previous fix introduced a regression on machines without the BMI1
instruction set extension.  The TZCNT instruction used in this function
behaves different on old machines when the source operand is zero, but
the code was originally designed to never trigger this case.  The bug
fix caused this case to be possible, leading to a regression on
sufficiently old hardware.

Fix the code by messing with things such that the source operand is
never zero.

PR:             291720
Fixes:          66eb78377bf109af1d9e25626bf254b4369436ec
Tested by:      cy
Approved by:    markj (mentor)
Differential Revision:  https://reviews.freebsd.org/D54303

(cherry picked from commit 2f83319214d9adb8ab7a77e35d1014658b3f9cae)
DeltaFile
+3-6lib/libc/amd64/string/stpncpy.S
+3-61 files

HardenedBSD/src e626fa0lib/libc/amd64/string stpncpy.S

libc/amd64: Disable baseline version of stpncpy()

This implementation appears to be broken on some CPUs.  Disable it
until the issue can be investigated and fixed.

PR:             291720
Fixes:          66eb78377bf1 ("libc/amd64: fix overread conditions in stpncpy()")
Fixes:          90253d49db09 ("lib/libc/amd64/string: add stpncpy scalar, baseline implementation")
(cherry picked from commit ce9557d4ee174267504a63b2c8f6009be27368c9)
DeltaFile
+2-0lib/libc/amd64/string/stpncpy.S
+2-01 files

HardenedBSD/src b49401clib/libc/amd64/string stpncpy.S

libc/amd64: fix overread conditions in stpncpy()

Due to incorrect unit test design, two overread conditions went
undetected in the amd64 baseline stpncpy() implementation.
For buffers of 1--16 and 32 bytes that do not contain nul bytes
and end exactly at a page boundary, the code would incorrectly
read 16 bytes from the next page, possibly crossing into an
unmapped page and crashing the program.  If the next page was
mapped, the code would then proceed with the expected behaviour
of the stpncpy() function.

Three changes were made to fix the bug:

 - an off-by-one error is fixed in the code deciding whether to
   enter the runt case or not, entering it for 0<n<=32 bytes
   instead of 0<n<32 bytes as it was before.
 - in the runt case, the logic to skip reading a second 16-byte
   chunk if the buffer ends in the first chunk was fixed to
   account for buffers that end at a 16-byte boundary but do not

    [18 lines not shown]
DeltaFile
+4-3lib/libc/amd64/string/stpncpy.S
+4-31 files

HardenedBSD/src 2f83319lib/libc/amd64/string stpncpy.S

libc/amd64: fix stpncpy.S again

The previous fix introduced a regression on machines without the BMI1
instruction set extension.  The TZCNT instruction used in this function
behaves different on old machines when the source operand is zero, but
the code was originally designed to never trigger this case.  The bug
fix caused this case to be possible, leading to a regression on
sufficiently old hardware.

Fix the code by messing with things such that the source operand is
never zero.

PR:             291720
Fixes:          66eb78377bf109af1d9e25626bf254b4369436ec
Tested by:      cy
Approved by:    markj (mentor)
Differential Revision:  https://reviews.freebsd.org/D54303
DeltaFile
+3-6lib/libc/amd64/string/stpncpy.S
+3-61 files