FreeBSD/src 8328ca3 — sys/compat/linux linux_ptrace.c

linux: Implement PTRACE_GETREGSET NT_PRFPREG and NT_X86_XSTATE

Implement NT_PRFPREG and NT_X86_XSTATE for PTRACE_GETREGSET on amd64.
Chrome's crashpad handler uses these to collect floating-point and
extended CPU register state for crash dumps.

Other architectures retain the previous EINVAL stub behavior.

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
PR:             289285
Reviewed by:    kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2165

(cherry picked from commit c515e6040614434a9262ee8b5ac54b81476ec7ff)
DeltaFile
+85-6sys/compat/linux/linux_ptrace.c
+85-61 files

FreeBSD/src d8f8031 — sys/amd64/linux linux.h linux_machdep.c

linux: Add linux_pt_fpregset and bsd_to_linux_fpregset() for amd64

Add struct linux_pt_fpregset, the amd64 Linux NT_PRFPREG payload,
corresponding to user_i387_struct in Linux. The struct describes
the 512-byte FXSAVE area as exposed by PTRACE_GETREGSET.

Add bsd_to_linux_fpregset() to translate from FreeBSD's struct fpreg
to struct linux_pt_fpregset. Fields are extracted from the fpr_env[]
array which stores the FXSAVE environment packed as four 64-bit words.
The FP and XMM register banks are bulk-copied as opaque byte arrays.

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
Reviewed by:    kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2165

(cherry picked from commit b84d31ee74535a0026ff83f2a34c07b7557f9785)
DeltaFile
+20-0sys/amd64/linux/linux_machdep.c
+18-0sys/amd64/linux/linux.h
+38-02 files

FreeBSD/src 29b79c5 — sys/amd64/linux linux.h, sys/amd64/linux32 linux.h

linux: Ignore sigaction(2) flags SA_UNSUPPORTED and SA_EXPOSE_TAGBITS

SA_UNSUPPORTED was introduced in Linux 5.11 to probe support
for other flags such as SA_EXPOSE_TAGBITS, introduced
at the same time. Ignore both.

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
PR:             289285
Reviewed by:    pouria, kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2163

(cherry picked from commit fdea83a5f63b881ade91c6cc9dfbf173137512c5)
DeltaFile
+8-0sys/compat/linux/linux_signal.c
+2-0sys/i386/linux/linux.h
+2-0sys/arm64/linux/linux.h
+2-0sys/amd64/linux32/linux.h
+2-0sys/amd64/linux/linux.h
+16-05 files

FreeBSD/src 6e8786b — sys/amd64/amd64 pmap.c, sys/arm64/arm64 pmap.c

amd64/arm64 pmap: consistently clear PGA_WRITEABLE

We don't consistently clear PGA_WRITEABLE on fictitious, managed pages.
Some functions do, e.g., pmap_remove_all(), but several do not.  At
worst, this is just a pessimization, but there is no good reason to be
inconsistent.  Clear PGA_WRITEABLE in those that previously did not by
introducing (and using) the helper function pmap_page_is_mapped_locked()
that implements the correct test.

(cherry picked from commit 37321270b630d891e48851f81dd6d077ebd6b635)
DeltaFile
+28-36sys/arm64/arm64/pmap.c
+25-28sys/amd64/amd64/pmap.c
+53-642 files

FreeBSD/src 91d8163 — libexec/rtld-elf rtld.c

rtld: fix leak in get_program_var_addr() on the error path

Fixes:  1e370f038778 ("rtld: stop using unbound alloca()")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+3-1libexec/rtld-elf/rtld.c
+3-11 files

FreeBSD/src 175595b — libexec/rtld-elf rtld.c

dl_iterate_phdr(3): do not return garbage for objects not using TLS

For objects without a TLS segment, tlsindex is zero. tls_get_addr_slow()
then reads dtv_slots[-1], which is dtv_size, and returns it as the TLS
address. Set dlpi_tls_data to NULL for such objects instead.

Fixes:  d36d68161517 ("rtld dl_iterate_phdr(): dlpi_tls_data is wrong")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+6-2libexec/rtld-elf/rtld.c
+6-21 files

FreeBSD/src e2979f4 — libexec/rtld-elf rtld.c

rtld: some cosmetics in donelist_init()

Add a missing word in the comment.
Make each assignment a separate statement.
Fix formatting.

Fixes:  1e370f038778 ("rtld: stop using unbound alloca()")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+5-5libexec/rtld-elf/rtld.c
+5-51 files

FreeBSD/src 83fdec2 — sys/kern vfs_init.c

vfs_register: prevent kernel crash

vfs_register hashes the filesystem name and uses it for sysctl oids.
A filesystem name which hashes to 0 crashes in sysctl_register_oid().

Map 0 to 1 to prevent the kernel crash.

This can be tested with "udf2" as the filesystem name.

MFC after:      1 month
MFC to:         stable/15 stable/14
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59839

(cherry picked from commit 3897678132e71df70dbb18bf8e2f19124beee5d7)
DeltaFile
+2-0sys/kern/vfs_init.c
+2-01 files

FreeBSD/src f581891 — sys/kern vfs_init.c

vfs_register: prevent kernel crash

vfs_register hashes the filesystem name and uses it for sysctl oids.
A filesystem name which hashes to 0 crashes in sysctl_register_oid().

Map 0 to 1 to prevent the kernel crash.

This can be tested with "udf2" as the filesystem name.

MFC after:      1 month
MFC to:         stable/15 stable/14
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59839

(cherry picked from commit 3897678132e71df70dbb18bf8e2f19124beee5d7)
DeltaFile
+2-0sys/kern/vfs_init.c
+2-01 files

FreeBSD/src 6a936d9 — contrib/llvm-project/libunwind/include __libunwind_config.h, contrib/llvm-project/libunwind/src UnwindCursor.hpp

Merge commit 4d7292e58078 from llvm-project (by Minsoo Choo):

  [libunwind] Unwind through AArch64 FreeBSD signal trampolines (#235065)

  Retried from https://reviews.llvm.org/D155066.

  Recognize signal trampolines using KERN_PROC_SIGTRAMP when unwind
  metadata is unavailable. Restore the interrupted PC, LR, SP, general
  registers, and valid floating-point registers.

  Add coverage for unwinding out of an interrupted leaf function on both
  regular and alternate signal stacks.

  Assisted-by: GPT

MFC after:      1 week
DeltaFile
+76-1contrib/llvm-project/libunwind/src/UnwindCursor.hpp
+3-0contrib/llvm-project/libunwind/include/__libunwind_config.h
+79-12 files

FreeBSD/src 28ec7cb — contrib/llvm-project/libunwind/src assembly.h UnwindCursor.hpp

Merge commit fd4113508a64 from llvm-project (by Minsoo Choo):

  [libunwind] Support extended amd64 segment registers (#229176)

  Raise the amd64 DWARF register limit to 59 and add RFLAGS, all six
  segment selectors, FS.base, and GS.base to the register model. Capture
  the extended state and restore it when resuming, using sigreturn() on
  FreeBSD to restore selectors and bases together. Pack the state into the
  existing context buffers without changing their public sizes or the
  Windows XMM offsets.

  Add tests for register access, signal-frame CFI recovery, register
  bounds, and resume behavior.

  Assisted-by: GPT

MFC after:      1 week
DeltaFile
+92-7contrib/llvm-project/libunwind/src/Registers.hpp
+62-7contrib/llvm-project/libunwind/src/UnwindRegistersRestore.S
+57-5contrib/llvm-project/libunwind/src/UnwindRegistersSave.S
+52-0contrib/llvm-project/libunwind/src/libunwind.cpp
+27-0contrib/llvm-project/libunwind/src/UnwindCursor.hpp
+18-0contrib/llvm-project/libunwind/src/assembly.h
+308-193 files not shown
+320-229 files

FreeBSD/src f7114dc — libexec/pkg-serve pkg-serve.8

manpages: Fix unusual Xr order
DeltaFile
+1-1libexec/pkg-serve/pkg-serve.8
+1-11 files

FreeBSD/src 44a5cf1 — usr.bin/iscsictl iscsictl.8, usr.bin/netstat netstat.1

manpages: Fix unusual Xr order
DeltaFile
+2-2usr.bin/tcopy/tcopy.1
+2-2usr.bin/sockstat/sockstat.1
+1-1usr.bin/runat/runat.1
+1-1usr.bin/procstat/procstat.1
+1-1usr.bin/netstat/netstat.1
+1-1usr.bin/iscsictl/iscsictl.8
+8-86 files

FreeBSD/src 3f4743d — usr.sbin/apm apm.8, usr.sbin/arp arp.8

manpages: Fix unusual Xr order
DeltaFile
+2-2usr.sbin/moused/msconvd/msconvd.8
+1-1usr.sbin/moused/moused/moused.8
+1-1usr.sbin/arp/arp.8
+1-1usr.sbin/apm/apm.8
+5-54 files

FreeBSD/src 7411972 — sbin/mount mount.8, sbin/mount_nfs mount_nfs.8

manpages: Fix unusual Xr order
DeltaFile
+1-1sbin/savecore/savecore.8
+1-1sbin/mount_nfs/mount_nfs.8
+1-1sbin/mount/mount.8
+3-33 files

FreeBSD/src 14680d2 — bin/ps ps.1

ps.1: Fix unusual Xr order
DeltaFile
+2-2bin/ps/ps.1
+2-21 files

FreeBSD/src 51a5311 — bin/df df.1

df.1: Fix unusual Xr order
DeltaFile
+1-1bin/df/df.1
+1-11 files

FreeBSD/src 8dac0bd — sys/dev/sound/pci/hda hdac.h hdac.c

snd_hda: Identify AMD Audio Coprocessor

This makes the driver attach, but the device is still not usable.

Reported by:    Lukasz Wencki <lukasz at smail.net.pl>
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-0sys/dev/sound/pci/hda/hdac.h
+1-0sys/dev/sound/pci/hda/hdac.c
+2-02 files

FreeBSD/src 83f24cf — sys/powerpc/powerpc exec_machdep.c

powerpc: keep the VSX halves of the FPRs across back-to-back signals

grab_mcontext() only put the second halves of vs0-31 into the context
while the thread owned the VSX unit, but sigreturn(2) gives ownership
up so that the next use reloads the registers lazily. A signal that
arrives right after a sigreturn, like one the handler's mask was
holding back, got a context without them and its own sigreturn then
zeroed them in the PCB.

The halves saved in the PCB are current whenever the FP state is, since
VSX instructions can't run without PCB_VSX and save_fpu() stores them
in that case, so export them together with the FP registers.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60754

(cherry picked from commit 64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d)
(cherry picked from commit 0e9af9fb72884e77de79e37069a162e1563ca86b)
DeltaFile
+14-6sys/powerpc/powerpc/exec_machdep.c
+14-61 files

FreeBSD/src 0e9af9f — sys/powerpc/powerpc exec_machdep.c

powerpc: keep the VSX halves of the FPRs across back-to-back signals

grab_mcontext() only put the second halves of vs0-31 into the context
while the thread owned the VSX unit, but sigreturn(2) gives ownership
up so that the next use reloads the registers lazily. A signal that
arrives right after a sigreturn, like one the handler's mask was
holding back, got a context without them and its own sigreturn then
zeroed them in the PCB.

The halves saved in the PCB are current whenever the FP state is, since
VSX instructions can't run without PCB_VSX and save_fpu() stores them
in that case, so export them together with the FP registers.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60754

(cherry picked from commit 64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d)
DeltaFile
+14-6sys/powerpc/powerpc/exec_machdep.c
+14-61 files

FreeBSD/src 3e05143 — . Makefile.in configure, admin ltmain.sh

kyua: import kyua-0.15.1

This change adds kyua kyua-0.15.1 from [upstream][1].

The kyua-0.15.1 artifact was been verified by [SHA256 checksum][3].

This release contains several (largely minor) bugfixes: the primary focus was
to address issues found when using the GoogleTest parser with Kyua 0.15.0.

More information about the release (from a high level) can be found in
the [release notes][4].

Updated via [`update_kyua.sh`][4] `update_kyua.sh 0.15.1 kyua-0.15.1`.

1: https://github.com/freebsd/kyua/releases/download/kyua-0.15.1/kyua-0.15.1.tar.gz
2: https://github.com/freebsd/kyua/releases/download/kyua-0.15.1/kyua-0.15.1.tar.gz.sha256
3: https://github.com/freebsd/kyua/blob/kyua-0.15.1/NEWS.md
4: https://codeberg.org/ngie/freebsd-powertools:shell/update_kyua.sh@10a04edb
DeltaFile
+601-159m4/libtool.m4
+442-230configure
+245-80admin/ltmain.sh
+134-63engine/googletest_result.cpp
+111-30engine/googletest_result_test.cpp
+93-37Makefile.in
+1,626-59932 files not shown
+1,845-86038 files

FreeBSD/src dc1514e — sys/x86/include sysarch.h

x86: make machine/sysarch.h usable from assembler

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+8-4sys/x86/include/sysarch.h
+8-41 files

FreeBSD/src a3214d4 — share/mk bsd.confs.mk

share/mk/bsd.confs.mk: fix trivial typo in message

The error message noting that the file should not be included said
"bsd.conf.mk" before this change. Now it correctly says "bsd.confs.mk".

MFC after:      3 days
DeltaFile
+1-1share/mk/bsd.confs.mk
+1-11 files

FreeBSD/src 81f86c9 — sys/dev/usb/net if_smsc.c

smsc: Allow 10BASE-T1L/-T1S media

These are Single-Pair Ethernet types (SPE) from 802.3cg. smsc sets the
link flag only if mii_media_active is one of a known set of media types.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60745
DeltaFile
+2-0sys/dev/usb/net/if_smsc.c
+2-01 files

FreeBSD/src b958547 — sbin/sysctl sysctl.8

jail.8: fix a typo, sort Xr

PR:             299990 (typo part)
MFC after:      1 week
DeltaFile
+3-3sbin/sysctl/sysctl.8
+3-31 files

FreeBSD/src e809c7d — usr.sbin/bhyve pci_nvme.c config_schema.h, usr.sbin/bhyve/aarch64 bhyverun_machdep.c

bhyve: add command to list config options

For a software built on top of bhyve(8) and/or managing bhyve(8),
it is very convenient to know what specific features the given binary supports.
Currently, bhyve(8) provides some of this information, and it could be
retrieved by parsing `bhyve -h`, `bhyve -s help`, `bhyve -l help`.

Sometimes it is not enough, for example, the recently added
"oemstrings" feature cannot be fully probed using these commands.
Over time, some workarounds were suggested. Specifically:

 - Mapping features to __FreeBSD_version. I see at least two issues with
   that:

     * __FreeBSD_version does not directly map to bhyve(8) features,
       so this is simply not accurate.
     * bhyve(8) might be updated separately from the system, which
       is not so uncommon, especially for development purposes.
       Then such a probing will be inaccurate.

    [32 lines not shown]
DeltaFile
+202-0usr.sbin/bhyve/config_schema.c
+95-0usr.sbin/bhyve/amd64/bhyverun_machdep.c
+40-0usr.sbin/bhyve/config_schema.h
+22-0usr.sbin/bhyve/aarch64/bhyverun_machdep.c
+20-0usr.sbin/bhyve/pci_nvme.c
+18-0usr.sbin/bhyve/riscv/bhyverun_machdep.c
+397-04 files not shown
+423-110 files

FreeBSD/src a03b051 — usr.bin/locate/locate locate.1

locate.1: clarify bytes vs. characters

The database stores bytes, not characters. Remove the historical
note about 7-bit storage. Also document that -i ignores case only
for ASCII letters.

Reviewed by: ziaee
MFC after: 3 days
DeltaFile
+12-9usr.bin/locate/locate/locate.1
+12-91 files

FreeBSD/src a3d1d4e — sys/arm64/linux linux_sysvec.c

arm64 linux: Allow FUTEX_REQUEUE on arm64 by setting the brand flag

Better change is to provide the dedicated musl brandinfo, as it is done
on amd64/i386, which should be done later.

PR:     299836
MFC after:      1 week
DeltaFile
+2-1sys/arm64/linux/linux_sysvec.c
+2-11 files

FreeBSD/src 9a8d5af — sys/compat/linux linux_misc.c

linux: correct errors from mremap(2)

Linux returns EFAULT when the range to be remapped is not mapped at all,
and ENOMEM only when it is mapped but cannot be grown in place. Callers
depend on that distinction: musl's pthread_getattr_np() measures the
main thread stack by growing a one page mapping and retries while errno
is ENOMEM. Returning ENOMEM for every growth request makes that loop
spin forever.

PR:     299835
MFC after:      1 week
DeltaFile
+5-2sys/compat/linux/linux_misc.c
+5-21 files

FreeBSD/src 30b7087 — sys/conf files, sys/dev/wg if_wg.c

wg: fix the LINT-NOIP build

We don't have anything to tunnel without INET or INET6, so just smack
it with the same config(5) hammer that ovpn uses and exclude it from
such builds.

Reported by:    mjg
Reviewed by:    emaste, markj

(cherry picked from commit 8430de47aa7c004e1330b8f6a3018c360425606e)
DeltaFile
+4-4sys/conf/files
+0-2sys/dev/wg/if_wg.c
+4-62 files