FreeBSD/src 2a678ffcontrib/atf/atf-c atf-c.3

atf-c(3): bump .Dd for the content change

MFC after:      2 weeks
MFC with:       a14573de29de
DeltaFile
+1-1contrib/atf/atf-c/atf-c.3
+1-11 files

FreeBSD/src a14573dcontrib/atf/atf-c atf-c.3

atf-c(3): fill in prototypes for functions

This change fills in prototypes for functions exposed by atf-c(3) to aid
the programmer with using the APIs with the library.

MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D50734
DeltaFile
+92-19contrib/atf/atf-c/atf-c.3
+92-191 files

FreeBSD/src cc9c213sys/fs/fuse fuse_internal.c, tests/sys/fs/fusefs pre-init.cc mockfs.cc

fusefs: Fix a panic when unmounting before init

fusefs would page fault due to the following sequence of events:
* The server did not respond to FUSE_INIT in timely fashion.
* Some other process tried to do unmount.
* That other process got killed by a signal.
* The server finally responded to FUSE_INIT.

PR:             287438
MFC after:      2 weeks
Sponsored by:   ConnectWise
Reviewed by:    arrowd
Differential Revision: https://reviews.freebsd.org/D50799
DeltaFile
+154-0tests/sys/fs/fusefs/pre-init.cc
+12-6tests/sys/fs/fusefs/mockfs.cc
+5-1tests/sys/fs/fusefs/mockfs.hh
+2-1tests/sys/fs/fusefs/utils.cc
+3-0sys/fs/fuse/fuse_internal.c
+2-0tests/sys/fs/fusefs/utils.hh
+178-81 files not shown
+179-87 files

FreeBSD/src 84e7307sys/dev/sound/pci/hda hdaa_patches.c hdac.h

snd_hda: Patch Lenovo T420s

PR:             222636
Tested by:      vermaden at interia.pl
Sponsored by:   The FreeBSD Foundation
MFC after:      1 day
DeltaFile
+16-0sys/dev/sound/pci/hda/hdaa_patches.c
+1-0sys/dev/sound/pci/hda/hdac.h
+17-02 files

FreeBSD/src 80c1295contrib/mandoc roff.c mdoc_html.c

mandoc: Vendor import of upstream at 2025-04-08

Interesting changes:
+ correct legacy mandoc date typo, reported on our very own bugzilla
+ improve libmandoc manual
+ strengthen recommendations to omit macros from title lines in mdoc(7)
+ improve html5 compliance in html output
+ improve RFC linking in markdown output
+ libmandoc and mdoc manuals have been improved
+ support arithmetic operations in tbl(7) column widths for DocBook
+ define the St -isoC-2023 macro for referencing the C23 spec

Approved by:    mhorne (mentor, implicit)
Reviewed by:    imp
Discussed with: adrian, bapt, brooks
Closes:         https://github.com/freebsd/freebsd-src/pull/1689
DeltaFile
+75-71contrib/mandoc/roff.c
+46-15contrib/mandoc/mdoc_html.c
+35-3contrib/mandoc/man.1
+35-2contrib/mandoc/mandoc.3
+21-15contrib/mandoc/tbl_layout.c
+32-3contrib/mandoc/mdoc_markdown.c
+244-10912 files not shown
+303-15018 files

FreeBSD/src 1b6936econtrib/mandoc st.c, lib/libc/string memccpy.3 memset.3

manuals: Align our tree with upstream C23 macro

Switch all instances of the -isoC-2024 macro to -isoC-2023 selected by
upstream. Keep -isoC-2024 defined, but deprecated, for backwards compat.

MFC after:      3 days (I will resolve merge conflicts with cdefs)
DeltaFile
+5-5share/man/man9/cdefs.9
+1-1lib/libc/string/memccpy.3
+1-1lib/libc/string/memset.3
+2-0contrib/mandoc/st.c
+9-74 files

FreeBSD/src f1ad434sys/vm vm_mmap.c

vm/vm_mmap.c: provide extended errors for most places

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D50792
DeltaFile
+81-22sys/vm/vm_mmap.c
+81-221 files

FreeBSD/src deeda8a. Makefile.inc1

Makefile.inc1: Cleanup manpages for arches not included in MAN_ARCH

Apply the fixes to cleanup the compressed or uncompressed man pages to
arches not in MAN_ARCH as well.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1295
Closes: https://github.com/freebsd/freebsd-src/pull/1295
DeltaFile
+13-0Makefile.inc1
+13-01 files

FreeBSD/src f580578. Makefile.inc1, share/mk bsd.man.mk

Makefile.inc1: Cleanup (un)compressed manpages

When switching between compressed and uncompressed manual pages, the
other type is left behind as divots. Compensate by removing the
now-unwanted man pages automatically.

Reviewed by: imp, jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1295
DeltaFile
+36-0Makefile.inc1
+2-4share/mk/bsd.man.mk
+38-42 files

FreeBSD/src 4acd63alib/libusb libusb10_hotplug.c

libusb: Fix netlink sysevent multicast group name

Reviewed by:    hrs
Differential Revision: https://reviews.freebsd.org/D50739
DeltaFile
+1-1lib/libusb/libusb10_hotplug.c
+1-11 files

FreeBSD/src f1830adlibexec/rtld-elf/amd64 reloc.c

rtld amd64: extend osrel check to enable tlsbase op on stable/14

This is a direct commit to stable/14.

Reported by:    Mark Millard <marklmi at yahoo.com>
Sponsored by:   The FreeBSD Foundation
DeltaFile
+5-1libexec/rtld-elf/amd64/reloc.c
+5-11 files

FreeBSD/src 0c89182sys/netinet6 nd6.c in6_var.h

netinet6: Remove ndpr_raf_ra_derived flag

This flag was introduced at 8036234c72c9361711e867cc1a0c6a7fe0babd84
to prevent the SIOCSPFXFLUSH_IN6 ioctl from removing manually-added
entries.  However, this flag did actually not work due to an
incomplete implementation making prelist_update() not handle it before
calling nd6_prelist_add().

This patch removes the flag because a prefix is derived from an RA
always has an entry in the ndpr_advrtrs member in the struct
nd_prefix.  Having a separate flag is not a good idea because it can
cause a mismatch between the flag and the ndpr_advrtrs entry.  Testing
using LIST_EMPTY() is simpler for the origial goal.

This also removes in a prefix check in the ICMPV6CTL_ND6_PRLIST sysctl
to exclude manually-added entries.  This ioctl is designed to list all
entries, and there is no relationship to SIOCSPFXFLUSH_IN6.

Differential Revision:  https://reviews.freebsd.org/D46441
DeltaFile
+3-5sys/netinet6/nd6.c
+1-3sys/netinet6/in6_var.h
+0-1sys/netinet6/nd6_rtr.c
+0-1sys/netinet6/nd6.h
+4-104 files

FreeBSD/src 7b7ba78lib/libsys clock_gettime.2 nanosleep.2, sys/kern kern_time.c kern_tc.c

Implement CLOCK_TAI

Provide a clock through clock_gettime() that returns the current TAI
time (UTC without leap seconds) as a complement to CLOCK_REALTIME. This
provides compatibility with Linux, which also provides a CLOCK_TAI since
kernel 2.6.26, and this seems to be becoming the standard way to acquire
TAI time. Unlike Linux, this code will return EINVAL if the TAI offset
(set by ntpd, ptpd, etc.) is not known since it seems pathological for
CLOCK_TAI to silently give the wrong (UTC) time if the offset is not
known as it does on Linux.

Reviewed by: imp
Differential Revision:  https://reviews.freebsd.org/D46268
DeltaFile
+31-15sys/kern/kern_time.c
+12-2lib/libsys/clock_gettime.2
+9-1sys/kern/kern_tc.c
+5-2sys/kern/kern_umtx.c
+4-0sys/sys/_clock_id.h
+3-1lib/libsys/nanosleep.2
+64-217 files not shown
+77-2613 files

FreeBSD/src 4deb976libexec/rc rc.subr

rc: Disable pathname expansion when calling run_rc_command()

Variables for command-line options like $foo_flags can contain characters
that perform pathname expansions, such as '[', ']', and '*'.  They were
passed without escaping, and the matched entries in the working directory
affected the command-line options.  This change turns off the expansion
when run_rc_command() is called.

While this changes the current behavior, an invocation of a service
program should not depend on entries in the working directory.

Differential Revision:  https://reviews.freebsd.org/D45855
DeltaFile
+4-0libexec/rc/rc.subr
+4-01 files

FreeBSD/src b60053flib/libcasper/services/cap_net cap_net.c

libcasper: Fix inconsistent error codes of cap_get{addr,name}info()

The get{addr,name}info(3) API is designed to return an API-specific error
code that is independent of errno.  The cap_get{addr,name}info() functions
returned either an errno or API-specific error code inconsistently.
This change fixes this mismatch.

When the API returns an errno, the return value itself is set to
EAI_SYSTEM and errno is set depending on the actual error.  So, usually
this API is called in the following form:

    error = getnameinfo(...);
    if (error == EAI_SYSTEM)
        perror("getnameinfo");
    else if (error)
        errx(1, "getnameinfo: %s", gai_strerror(error);

If the above getnameinfo() call is replaced with cap_getnameinfo(),
it breaks the error handling.  For example, the cap_get{addr,name}info()

    [7 lines not shown]
DeltaFile
+39-16lib/libcasper/services/cap_net/cap_net.c
+39-161 files

FreeBSD/src 6501b68lib/libcasper/services/cap_net cap_net.h

libcasper: Use __VA_ARGS__ for function-like macros

cap_net.h uses "#define cap_f(chan, a) f(a)" to call the conventional
service function with the first argument of cap_f() dropped for
compatibility with the environment where the casper service is
unavailable.  However, this function-like macro does not work when the
arguments contains C99 compound literals, such as f(chan, (int[]){1,2,3}).
The following is a typical example:

    error = cap_getaddrinfo(capnet, "192.168.0.1", "100",
        &(struct addrinfo){
            .ai_family = AF_INET,
            .ai_flags = AI_NUMERICHOST
    }, &res);

Using cap_f(chan, ...) and __VA_ARGS__ in C99 seems a reasonable solution
for this problem.  While there is a workaround using parenthesis around
the compound literal like f(chan, ((int[]){1,2,3})), it is not intuitive
and the above example works when the cap_net is available and f() is

    [9 lines not shown]
DeltaFile
+9-13lib/libcasper/services/cap_net/cap_net.h
+9-131 files

FreeBSD/src 94285afshare/man/man9 cpu_machdep.9

cpu_machdep.9: update documentation for cpu_set_user_tls()

(cherry picked from commit 461afb106107f38b4af23f42f5f99470ceef0877)
DeltaFile
+10-1share/man/man9/cpu_machdep.9
+10-11 files

FreeBSD/src 29b1c09lib/libc/sys thr_new.2

thr_new.2: document THR_C_RUNTIME

(cherry picked from commit 6fd3288c39c493c4f252b715e8354e0d27d5ef90)
DeltaFile
+9-0lib/libc/sys/thr_new.2
+9-01 files

FreeBSD/src 49e940dsys/amd64/amd64 sys_machdep.c, sys/x86/include sysarch.h

amd64: Add AMD64_DISABLE_TLSBASE

(cherry picked from commit 3a94bbfdcd09c655031e2a1ae343af6292d97d5d)
DeltaFile
+6-0sys/amd64/amd64/sys_machdep.c
+1-0sys/x86/include/sysarch.h
+7-02 files

FreeBSD/src d752f91sys/kern kern_thr.c

kern_thr.c: fix typo

(cherry picked from commit 3556ffa6adff34ed689185ac8c68a2fc9432741a)
DeltaFile
+1-1sys/kern/kern_thr.c
+1-11 files

FreeBSD/src a24bbfbsys/kern kern_thr.c

thr_new(2): check param.flags for reserved bits

(cherry picked from commit c25ddffc51a1e2c0e03fa6f168abc022955d598f)
DeltaFile
+3-0sys/kern/kern_thr.c
+3-01 files

FreeBSD/src c9c7058sys/amd64/amd64 vm_machdep.c

amd64: set PCB_TLSBASE pcb flag only for new C runtime threads

(cherry picked from commit 16ce7f1a3603fce5262cf0656a01c4177c75fa50)
DeltaFile
+4-1sys/amd64/amd64/vm_machdep.c
+4-11 files

FreeBSD/src ebf989flib/libthr/thread thr_create.c, sys/sys thr.h

thr_new: add a flag indicating that the thread is created by C runtime

(cherry picked from commit 89ca5cddec22f5676e9f9a91c2adfdbc574c78ca)
DeltaFile
+1-1lib/libthr/thread/thr_create.c
+1-0sys/sys/thr.h
+2-12 files

FreeBSD/src b7291e0sys/sys param.h

Bump __FreeBSD_version and provide P_OSREL_TLSBASE for amd64 set_tlsbase

(cherry picked from commit 0ec732913fceb9aae2d56c2dd667203711b76550)
DeltaFile
+2-1sys/sys/param.h
+2-11 files

FreeBSD/src 011c1f2sys/amd64/ia32 ia32_exception.S

amd64: revert unintended changes in ia32_exception.S

(cherry picked from commit 71186b6eaa070dda5229af374b584e5f65ce5fb3)
DeltaFile
+2-1sys/amd64/ia32/ia32_exception.S
+2-11 files

FreeBSD/src 8835964libexec/rtld-elf/amd64 reloc.c, sys/x86/include tls.h

amd64: switch to amd64_set_tlsbase to set tls base

(cherry picked from commit aef025fc9b6c8b06677086a93c866ee09622f6fa)
DeltaFile
+4-2libexec/rtld-elf/amd64/reloc.c
+1-1sys/x86/include/tls.h
+5-32 files

FreeBSD/src fa10e2fsys/amd64/amd64 exec_machdep.c, sys/x86/include ucontext.h frame.h

amd64: add mc_tlsbase member to mcontext

(cherry picked from commit eea3e4dd9703a252509d75814049aa8da5007ebb)
DeltaFile
+6-2sys/x86/include/ucontext.h
+6-0sys/amd64/amd64/exec_machdep.c
+1-0sys/x86/include/frame.h
+13-23 files

FreeBSD/src f89a247sys/amd64/amd64 vm_machdep.c, sys/arm/arm vm_machdep.c

thr_new: pass params.flags to cpu_set_user_tls()

(cherry picked from commit 2b8b37c8f516a5955f81a6fc35c7aac01ddf4a3a)
DeltaFile
+1-1sys/amd64/amd64/vm_machdep.c
+1-1sys/arm/arm/vm_machdep.c
+1-1sys/arm64/arm64/vm_machdep.c
+1-1sys/arm64/linux/linux_machdep.c
+1-1sys/i386/i386/vm_machdep.c
+1-1sys/kern/kern_thr.c
+6-63 files not shown
+9-99 files

FreeBSD/src 9bac318lib/libc/amd64 Symbol.map, lib/libc/amd64/sys amd64_set_tlsbase.c Makefile.inc

amd64: add amd64_set_tlsbase(3)

(cherry picked from commit 2e7cf772a4114b78eb0ab2687d91d563de89e206)
DeltaFile
+55-0lib/libc/amd64/sys/amd64_set_tlsbase.c
+4-0lib/libc/amd64/Symbol.map
+2-1lib/libc/amd64/sys/Makefile.inc
+1-0sys/x86/include/sysarch.h
+62-14 files

FreeBSD/src 4937026sys/amd64/amd64 ptrace_machdep.c, sys/x86/include ptrace.h

amd64: add ptrace PT_{GET,SET}TLSBASE requests

(cherry picked from commit 7171e591a4c70eb4ee616e33373fd62773ad5a08)
DeltaFile
+21-0sys/amd64/amd64/ptrace_machdep.c
+2-0sys/x86/include/ptrace.h
+23-02 files