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 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

HardenedBSD/src 9595055stand/common gfx_fb.c

loader.efi: only use firmware provided Blt on GOP

gfx_state.tg_private points to a EFI_GRAPHICS_OUTPUT_PROTOCOL only when
using GOP.

The firmware provided Blt functions on UGA platforms have been observed
to not work on old MacBooks, and are likley hit or miss anyways as UGA
has been deprecated since 2006.

Reviewed by:    tsoome
PR:             291935
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54432
DeltaFile
+6-2stand/common/gfx_fb.c
+6-21 files

HardenedBSD/src 5d85ddestand/efi/loader framebuffer.c

loader.efi: probe for UGA if GOP isn't found

Probe for UGA instead of returning early if we can't find GOP.

Reviewed by:    tsoome
PR:             291935
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54431
DeltaFile
+41-39stand/efi/loader/framebuffer.c
+41-391 files

HardenedBSD/src a56d463crypto/openssl FREEBSD-upgrade.md FREEBSD-upgrade, sys/compat/linuxkpi/common/include/linux printk.h seq_file.h

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+202-0crypto/openssl/FREEBSD-upgrade.md
+126-14sys/compat/linuxkpi/common/src/linux_compat.c
+0-122crypto/openssl/FREEBSD-upgrade
+8-2sys/compat/linuxkpi/common/include/linux/printk.h
+1-1sys/compat/linuxkpi/common/include/linux/seq_file.h
+337-1395 files

HardenedBSD/src 94ad274crypto/openssl FREEBSD-upgrade.md FREEBSD-upgrade, sys/compat/linuxkpi/common/include/linux printk.h seq_file.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+202-0crypto/openssl/FREEBSD-upgrade.md
+126-14sys/compat/linuxkpi/common/src/linux_compat.c
+0-122crypto/openssl/FREEBSD-upgrade
+8-2sys/compat/linuxkpi/common/include/linux/printk.h
+1-1sys/compat/linuxkpi/common/include/linux/seq_file.h
+337-1395 files

HardenedBSD/src 4ab2a36usr.sbin/bhyve bhyve.8 snapshot.c, usr.sbin/bhyvectl bhyvectl.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+17-6usr.sbin/bhyvectl/bhyvectl.c
+3-1usr.sbin/bhyve/bhyve.8
+1-1usr.sbin/bhyve/snapshot.c
+21-83 files

HardenedBSD/src b1bef9fsys/compat/linuxkpi/common/include/linux printk.h, sys/compat/linuxkpi/common/src linux_compat.c

linuxkpi: Add hex_dump_to_buffer()

This function prints a single line of hex dump to the given line buffer.

The implementation relies on `lkpi_hex_dump()` to format the string.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51559
DeltaFile
+70-0sys/compat/linuxkpi/common/src/linux_compat.c
+6-0sys/compat/linuxkpi/common/include/linux/printk.h
+76-02 files

HardenedBSD/src 43b5a26sys/compat/linuxkpi/common/include/linux printk.h seq_file.h, sys/compat/linuxkpi/common/src linux_compat.c

linuxkpi: Add option to skip trailing newline in `lkpi_hex_dump()`

This will be useful in the upcoming implementation of
`hex_dump_to_buffer()` which doesn't add one.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51844
DeltaFile
+6-4sys/compat/linuxkpi/common/src/linux_compat.c
+2-2sys/compat/linuxkpi/common/include/linux/printk.h
+1-1sys/compat/linuxkpi/common/include/linux/seq_file.h
+9-73 files

HardenedBSD/src 38d757bsys/compat/linuxkpi/common/src linux_compat.c

linuxkpi: Avoid trailing whitespaces in lkpi_hex_dump()

We use the return value of the callback to track the number of bytes
written. We use it to determine if a group of characters should be
prepended with a whitespace. This way, we never add a trailing
whitespace.

We need to pay attention to the return value of the callback: if it is
negative, it's an error and we return immediately. Otherwise, we would
decrease the number of written bytes and possibly make it negative.

Reviewed by:    bz, christos
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51558
DeltaFile
+53-13sys/compat/linuxkpi/common/src/linux_compat.c
+53-131 files

HardenedBSD/src 08cdcffcrypto/openssl FREEBSD-upgrade.md FREEBSD-upgrade

crypto/openssl: update vendor update instructions

This change fills out the requirements for doing vendor updates,
documents the new vendor update process, and guides whoever needs to do
the next version update a bit better than the documentation did prior to
this change so everyone can pitch in with version updates a bit better.

Convert the document to Markdown while here to make it easier to
render/print out the directions in a structured format.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D53190
DeltaFile
+202-0crypto/openssl/FREEBSD-upgrade.md
+0-122crypto/openssl/FREEBSD-upgrade
+202-1222 files

HardenedBSD/src 94cf9c9sys/powerpc/powerpc swtch64.S swtch32.S

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+1-1sys/powerpc/powerpc/swtch64.S
+1-1sys/powerpc/powerpc/swtch32.S
+2-22 files

HardenedBSD/src 72d72c9sys/powerpc/powerpc swtch64.S swtch32.S

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+1-1sys/powerpc/powerpc/swtch64.S
+1-1sys/powerpc/powerpc/swtch32.S
+2-22 files

HardenedBSD/src a5b8bc7sys/dev/ocs_fc ocs_utils.h ocs_ddump.h, sys/xen/xenbus xenbusvar.h

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+4-8sys/dev/ocs_fc/ocs_utils.h
+4-4sys/xen/xenbus/xenbusvar.h
+1-2sys/dev/ocs_fc/ocs_ddump.h
+1-2sys/dev/ocs_fc/ocs_mgmt.h
+1-1sys/xen/xenstore/xenstorevar.h
+1-1sys/dev/ocs_fc/ocs_os.h
+12-182 files not shown
+14-208 files

HardenedBSD/src a8fb630usr.sbin/bhyvectl bhyvectl.c

bhyvectl: improve options error handling

Currently, it is possible to execute bhyvectl(8) with mutually exclusive
options, such as "--destroy" and "--suspend", and it will print out
obscure errors, e.g.:

 bhyvectl --suspend=/var/run/vms/my_vm --destroy --vm my_vm
 connect() failed: Connection refused

Address that by failing early if mutually exclusive options were
specified.

Additionally, move the BHYVE_SNAPSHOT block before the errors are
printed, so its errors are also displayed.

Approved by:            markj
Sponsored by:           The FreeBSD Foundation
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D54092

    [2 lines not shown]
DeltaFile
+17-6usr.sbin/bhyvectl/bhyvectl.c
+17-61 files

HardenedBSD/src 894674dusr.sbin/bhyve bhyve.8 snapshot.c

bhyve: change suspend exit code

Currently, after suspending, bhyve(8) exits with 0. This code is
also used to indicate that a VM was rebooted. To differentiate
reboot and suspend, use the next available exit code, 5, for suspend.

Approved by:            markj
Sponsored by:           The FreeBSD Foundation
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D54087

(cherry picked from commit 611bbb190ff593e0e424e311575d7e978e623659)
DeltaFile
+3-1usr.sbin/bhyve/bhyve.8
+1-1usr.sbin/bhyve/snapshot.c
+4-22 files

HardenedBSD/src 8df2e54sys/powerpc/powerpc swtch64.S swtch32.S

powerpc: put the isync inside the TD_LOCK() checking loop

Fix a narrow window where the lock is unlocked but the checking CPU
hasn't flushed things appropriately.

Inside this window the CPU inside cpu_switch() will loop forever thinking
the destination thread is still blocked/locked even though it is not.

This manifests as the system hanging after starting all APs.

I've seen this reliably trigger in qemu-system-ppc64 running power9 pseries
guests; the more CPUs the more likely it triggers at boot.

PR: kern/292167
Differential Revision:  https://reviews.freebsd.org/D54478
Reviewed by:    jhibbits
MFC after:      1 week
Relnotes:       yes
DeltaFile
+1-1sys/powerpc/powerpc/swtch64.S
+1-1sys/powerpc/powerpc/swtch32.S
+2-22 files

HardenedBSD/src 05230e3sys/dev/xen/blkback blkback.c, sys/xen xen_intr.h

sys/xen: Use __printflike() instead of format(printf)

The __printflike macro sets the format to freebsd_kprintf which recent
clang understands and warns about. Fixes the following error:
`passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]`

MFC after:      1 week

(cherry picked from commit 4cd7be3e81863bd22aacccc34fc2e8b2cfcb14d9)
DeltaFile
+4-4sys/xen/xenbus/xenbusvar.h
+1-1sys/xen/xen_intr.h
+1-1sys/xen/xenstore/xenstorevar.h
+1-1sys/dev/xen/blkback/blkback.c
+7-74 files

HardenedBSD/src 9742a31sys/dev/ocs_fc ocs_utils.h ocs_ddump.h

ocs_fc: Use __printflike() instead of format(printf)

The __printflike macro sets the format to freebsd_kprintf which recent
clang understands and warns about. Fixes the following error:
`passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]`

MFC after:      1 week

(cherry picked from commit 3c0ea1b629764c49611e3e3adfa0c44f9afa3558)
DeltaFile
+4-8sys/dev/ocs_fc/ocs_utils.h
+1-2sys/dev/ocs_fc/ocs_ddump.h
+1-2sys/dev/ocs_fc/ocs_mgmt.h
+1-1sys/dev/ocs_fc/ocs_os.h
+7-134 files

HardenedBSD/src 7e49807lib/libgeom geom_xml2tree.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+5-2lib/libgeom/geom_xml2tree.c
+5-21 files

HardenedBSD/src ea6262flib/libgeom geom_xml2tree.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+5-2lib/libgeom/geom_xml2tree.c
+5-21 files

HardenedBSD/src 17355cflib/libgeom geom_xml2tree.c

libgeom: Fix 32-bit gcc build

MFC after:      1 week
Fixes:          27894e20f140 ("libgeom: Fix segfault in 32-on-64 case")
DeltaFile
+5-2lib/libgeom/geom_xml2tree.c
+5-21 files