HardenedBSD/src 04a3a6e — sys/powerpc/powerpc cpu.c

powerpc/idle: Set 'RL' field in PSSCR on POWER9

The POWER9 does not do automatic state transitions when idling, so the
'MTL' field (Maximum Transition Level) is ignored.  Thus, setting '0'
for the 'RL' field (Requested Level) as was done means it
doesn't transition to any power saving level.  To fix this, set both the
'MTL' and the 'RL' fields to the same level.

On a Talos II at idle this drops the reported temperatures by ~10-15%.

MFC after:      3 days
DeltaFile
+2-1sys/powerpc/powerpc/cpu.c
+2-11 files

HardenedBSD/src f22d659 — contrib/elftoolchain/libdwarf dwarf.h dwarf_dump.c

libdwarf: standard DWARF 5 form names, DW_LANG_C17 and C23

7bb441c86678 added the fixed-size string and address index forms
0x25 to 0x2c as DW_FORM_ref_strx1..4 and DW_FORM_ref_addrx1..4; the
standard (DWARF 5, table 7.6) names them DW_FORM_strx1..4 and
DW_FORM_addrx1..4, with no "ref".  Rename them, keep the old spellings
as aliases since the header is installed, and update dwarf_dump.c's
form names accordingly.  Add DW_LANG_C17 (0x2c) and DW_LANG_C23 (0x3e),
which clang emits for -std=c17 and -std=c23 units.  ctfconv(1) needs
all of these; it carried them in a private header until now.

Reviewed by:    markj, emaste
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D61154
DeltaFile
+16-16contrib/elftoolchain/libdwarf/dwarf_dump.c
+19-8contrib/elftoolchain/libdwarf/dwarf.h
+35-242 files

HardenedBSD/src ea623d9 — sys/crypto/openssl/aarch64 sm4-armv8.S vpsm4_ex-armv8.S, sys/crypto/openssl/i386 rc5-586.S cast-586.S

openssl: stop generating asm that nothing builds

Makefile.asm generated eight perlasm outputs that neither libcrypto nor
the kernel builds. Additionally, upstream does not build them for these
architectures with FreeBSD's configuration:

- aarch64: ecp_sm2p256-armv8, sm3-armv8, sm4-armv8, vpsm4-armv8 and
  vpsm4_ex-armv8.  SM2, SM3 and SM4 are disabled (disable-sm2/sm3/sm4).
- i386: cast-586 (upstream's x86 configuration uses the C CAST code)
  and rc5-586 (RC5 is disabled by default).
- powerpc: aes-gcm-ppc.  Upstream builds it only for 64-bit
  little-endian; libcrypto and ossl(4) use it only on powerpc64 and
  powerpc64le, whose copies stay.

Remove them from Makefile.asm and delete the generated files, so the
next vendor import does not regenerate them.  If one of these algorithms
is ever enabled, add its script back to Makefile.asm and run "make
buildasm".


    [10 lines not shown]
DeltaFile
+0-5,021sys/crypto/openssl/aarch64/vpsm4-armv8.S
+0-4,543sys/crypto/openssl/aarch64/vpsm4_ex-armv8.S
+0-2,002sys/crypto/openssl/i386/cast-586.S
+0-1,264sys/crypto/openssl/i386/rc5-586.S
+0-1,093sys/crypto/openssl/aarch64/sm4-armv8.S
+0-988sys/crypto/openssl/powerpc/aes-gcm-ppc.S
+0-14,9113 files not shown
+3-16,2769 files

HardenedBSD/src 1a65fd9 — lib/libc/string bstring.3

Revert "bstring.3: no cross reference to self"

This reverts commit ef7d29b0df91d32c0b880796acd969a0a00ecf47.
DeltaFile
+9-1lib/libc/string/bstring.3
+9-11 files

HardenedBSD/src 724bb39 — sys/contrib/zlib gzwrite.c inflate.c

MFV: zlib 1.4

MFC after:      1 week
DeltaFile
+100-41sys/contrib/zlib/gzread.c
+73-37sys/contrib/zlib/deflate.c
+44-33sys/contrib/zlib/zlib.h
+37-37sys/contrib/zlib/gzlib.c
+43-13sys/contrib/zlib/inflate.c
+40-8sys/contrib/zlib/gzwrite.c
+337-16917 files not shown
+452-19723 files

HardenedBSD/src 18eec80 — lib/libc/string string.3

Revert "string.3: no cross reference to self"

This reverts commit 0448f4d0a4359670e8ad2ec72d0a826685517ae7.
DeltaFile
+17-0lib/libc/string/string.3
+17-01 files

HardenedBSD/src ba64f15 — usr.sbin/mountd mountd.8

mountd.8: fix link to syslog(3)

Reported by: des (prev. commit)
DeltaFile
+1-1usr.sbin/mountd/mountd.8
+1-11 files

HardenedBSD/src 9b6bfb5 — lib/libc/stdio mktemp.3, lib/libpmc pmc.dmc-620.3

manpages: normalizing date format
DeltaFile
+1-1usr.bin/genl/genl.1
+1-1sys/teken/libteken/teken.3
+1-1lib/libpmc/pmc.dmc-620.3
+1-1lib/libc/stdio/mktemp.3
+4-44 files

HardenedBSD/src 11a64df — share/man/man4 uhid.4 splash.4, share/man/man9 osd.9

manpages: normalizing date format
DeltaFile
+1-1share/man/man9/osd.9
+1-1share/man/man4/uhid.4
+1-1share/man/man4/splash.4
+1-1share/man/man4/pfsync.4
+1-1share/man/man4/ncthwm.4
+1-1share/man/man4/nctgpio.4
+6-63 files not shown
+9-99 files

HardenedBSD/src 2b27613 — share/man/man4 ufintek.4 pflog.4, share/man/man9 sx.9

manpages: date typos
DeltaFile
+1-1usr.sbin/ntp/doc/ntptrace.8
+1-1usr.sbin/nfsd/nfsv4.4
+1-1stand/i386/cdboot/cdboot.8
+1-1share/man/man9/sx.9
+1-1share/man/man4/ufintek.4
+1-1share/man/man4/pflog.4
+6-63 files not shown
+9-99 files

HardenedBSD/src ebd89b9 — lib/libsys sched_getcpu.3, lib/libsysdecode sysdecode_mask.3

manpages: missing section argument for .Xr macro
DeltaFile
+2-2usr.sbin/nfsd/pnfsserver.4
+1-1usr.sbin/pnfsdsfile/pnfsdsfile.8
+1-1usr.sbin/nfsd/pnfs.4
+1-1share/man/man7/environ.7
+1-1lib/libsysdecode/sysdecode_mask.3
+1-1lib/libsys/sched_getcpu.3
+7-71 files not shown
+8-87 files

HardenedBSD/src 22b4975 — lib/libc/gen uexterror.3 uexterr_gettext.3, share/man/man9 exterror.9

manpages: Fix unusual Xr order
DeltaFile
+1-1usr.sbin/quot/quot.8
+1-1share/man/man9/exterror.9
+1-1lib/libc/gen/uexterror.3
+1-1lib/libc/gen/uexterr_gettext.3
+4-44 files

HardenedBSD/src 989ff10 — usr.sbin/setaudit setaudit.8

setaudit.8: remove empty macro Xr
DeltaFile
+0-1usr.sbin/setaudit/setaudit.8
+0-11 files

HardenedBSD/src fddd0bc — lib/libc/gen setproctitle.3, lib/libmd sha512.3

manpages: missing comma before name
DeltaFile
+1-2lib/msun/man/clog.3
+1-1lib/msun/man/sqrt.3
+1-1lib/libpmc/pmc.amd.3
+1-1lib/libmd/sha512.3
+1-1lib/libc/gen/setproctitle.3
+5-65 files

HardenedBSD/src 186f14e — share/man/man3 pthread_join.3 tree.3, share/man/man9 OF_device_from_xref.9

manpages: missing comma before name
DeltaFile
+2-2share/man/man3/tree.3
+1-1share/man/man9/OF_device_from_xref.9
+1-1share/man/man3/pthread_join.3
+4-43 files

HardenedBSD/src a84b9db — lib/libc/gen tcgetwinsize.3

tcgetwinsize.3: typo in section name

.Sh RETURN VALUE instead of RETURN VALUES
DeltaFile
+1-1lib/libc/gen/tcgetwinsize.3
+1-11 files

HardenedBSD/src 81d09d4 — lib/msun/man fegetenv.3

fegetenv.3: no cross reference to self
DeltaFile
+0-1lib/msun/man/fegetenv.3
+0-11 files

HardenedBSD/src 0aa6428 — sys/netinet tcp_output.c

tcp: address PR295870

Fix accounting in the sequence space for a FIN bit potentially
piggy bagged during SACK loss recovery triggered transmissions.

Reviewed By: #transport, tuexen
Sponsored by: NetApp, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D61312
DeltaFile
+10-1sys/netinet/tcp_output.c
+10-11 files

HardenedBSD/src 097f6d7 — sys/kern link_elf_obj.c

link_elf_obj: fix an off-by-one in the symbol string table index check

link_elf_load_file() checks the symbol table's sh_link against
e_shnum with ">" instead of ">=", so a malformed object whose sh_link
equals e_shnum makes the linker read one entry past the section header
array before the sh_type check rejects it.  Use ">=", as
link_elf_link_preload() already does.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61055
DeltaFile
+1-1sys/kern/link_elf_obj.c
+1-11 files

HardenedBSD/src 8e7f9aa — sys/amd64/vmm vmm_instruction_emul.c

vmm: Emulate the byte forms of OR and AND with an immediate

Opcode 0x80 (group 1: r/m8, imm8) is in the decode table and
emulate_cmp() handles 80 /7, but emulate_or() and emulate_and() only
accept 0x81 and 0x83.  An "or byte ptr [mem], imm8" or "and byte ptr
[mem], imm8" on emulated memory therefore fails with EINVAL and bhyve
stops the guest with "Failed to emulate instruction sequence
[ 80 ... ]".  Seen with macOS: VoodooHDA starts the HDA controller's
CORB with "or byte [rax+0x4c], 2" (CORBCTL |= CORBRUN), and the guest
died at the first sound.

Accept 0x80 in both, with a one byte operand as emulate_cmp() does.
The file is shared with bhyve(8), so the fix covers the in-kernel
devices (HPET, local APIC without APICv, I/O APIC) and the user space
device models alike.

Signed-off-by: Wanpeng Qian <wanpengqian at gmail.com>

Reviewed by:    markj

    [3 lines not shown]
DeltaFile
+12-0sys/amd64/vmm/vmm_instruction_emul.c
+12-01 files

HardenedBSD/src 8644c3b — sys/kern link_elf_obj.c

link_elf_obj: bounds-check a relocation section's sh_info

sh_info is used to index the section header array without checking it
against e_shnum, so a malformed object can make the linker read out of
bounds.  Reject such a file with ENOEXEC in both the preload and kldload
paths.

MFC after:      1 week
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D60937
DeltaFile
+16-0sys/kern/link_elf_obj.c
+16-01 files

HardenedBSD/src 14d828a — sys/kern link_elf_obj.c

link_elf_obj: guard reltab/relatab frees in link_elf_unload_file()

link_elf_unload_file() frees the per-section relocation tables by iterating
ef->nreltab / ef->nrelatab, but dereferences ef->reltab / ef->relatab
unconditionally. The counts are set while scanning the section headers, before
the tables are allocated, so an error on the load path reaches it with a
non-zero count and a NULL table, faulting on ef->relatab[0].rela. Reachable
from link_elf_load_file() once a valid relocation section has been counted,
e.g. a later section with sh_info >= e_shnum (D60937).

Guard the loops with the table pointer, as is already done for ef->progtab
above.

MFC after:      1 week
Reviewed by:    markj, kib
Differential Revision:  https://reviews.freebsd.org/D61140
DeltaFile
+10-6sys/kern/link_elf_obj.c
+10-61 files

HardenedBSD/src 956a05c — stand/i386/gptzfsboot zfsboot.c

gptzfsboot: Use snprintf() to format file names

The stack buffer in fs_list() can be overflowed if a file name is too
long.

Reported by:    Yudi Yang <yudi.yang at rice.edu>
MFC after:      1 week
DeltaFile
+1-1stand/i386/gptzfsboot/zfsboot.c
+1-11 files

HardenedBSD/src 9669115 — sys/netinet/tcp_stacks rack.c

Mark Johnsons Claude code found a duplicate call to rack_check_reorder_ack() in rack.c

Mark's Claude code properly points out an interesting bug case where if a new block is
created from a sack aka

        rsm |--------|
    sackblk    |--------->
Then when the new block is created rack_check_reorder_ack() is called and then called again when
the block is actually ack'ed. Proper thing is to *not* in this case call the function and only call
it at the processing to ACK. You leave the hookery side however since that is just transfering
the existing block pointers.

Differential Revision:https://reviews.freebsd.org/D61159
DeltaFile
+4-2sys/netinet/tcp_stacks/rack.c
+4-21 files

HardenedBSD/src 5d62207 — lib/libc/gen err.3

libc/gen/err.3: reword to refer to exterror.9

Requested by:   wosch
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+4-2lib/libc/gen/err.3
+4-21 files

HardenedBSD/src 2151eb5 — sys/kern kern_mib.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+0-4sys/kern/kern_mib.c
+0-41 files

HardenedBSD/src 0448f4d — lib/libc/string string.3

string.3: no cross reference to self
DeltaFile
+0-17lib/libc/string/string.3
+0-171 files

HardenedBSD/src ef7d29b — lib/libc/string bstring.3

bstring.3: no cross reference to self
DeltaFile
+1-9lib/libc/string/bstring.3
+1-91 files

HardenedBSD/src b6c96b9 — usr.sbin/quot quot.8

quot.8: fix ffs xrefs after move to section 4
DeltaFile
+2-2usr.sbin/quot/quot.8
+2-21 files

HardenedBSD/src 27b116c — usr.sbin/mountd mountd.8

mountd.8: fix link to syslogd(8)
DeltaFile
+2-2usr.sbin/mountd/mountd.8
+2-21 files