FreeBSD/src 4c860dbsys/sys stdatomic.h

libc: Fix ATOMIC_VAR_INIT visibility

Fixes:          28cecfe27964 ("libc: Restrict ATOMIC_VAR_INIT for C23 conformance")
Reviewed by:    fuz, imp
Differential Revision:  https://reviews.freebsd.org/D57724
DeltaFile
+1-1sys/sys/stdatomic.h
+1-11 files

FreeBSD/src c37839dshare/mk gendirdeps.mk meta.autodep.mk

meta.autodep.mk remove extra }

remove extra } from GENDIRDEPS_ENV

more debug output for gendirdeps.mk

Reviewed by:    stevek
Differential Revision:  https://reviews.freebsd.org/D57727
DeltaFile
+11-3share/mk/gendirdeps.mk
+3-3share/mk/meta.autodep.mk
+14-62 files

FreeBSD/src 704db3f. UPDATING Makefile, share/man/man7 build.7

Source upgrade doc: etcupdate no longer needs -B

Note: We confusingly have the instructions to build the system in the
build manual, the UPDATING file, and the Makefile. These will get out
of sync and will be harmful when they do.

Fixes:  ddf6fad0295a ("etcupdate: Make nobuild the default")
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D57644
DeltaFile
+2-2share/man/man7/build.7
+2-2UPDATING
+1-1Makefile
+5-53 files

FreeBSD/src 015b890lib/libc/string memccpy.3 memmove.3

mem*.3: stop refering to strings

POSIX and the C standard now refer to objects and sequences rather
than confusingly revering to strings.

Also update bcopy(3) and bzero(3).

Reviewed by:    emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57680
DeltaFile
+6-6lib/libc/string/memccpy.3
+5-5lib/libc/string/memmove.3
+5-5lib/libc/string/bcopy.3
+4-4lib/libc/string/memmem.3
+4-4lib/libc/string/memcpy.3
+3-3lib/libc/string/memset.3
+27-271 files not shown
+30-307 files

FreeBSD/src 8b47939sys/kern uipc_socket.c

uipc_socket: prefer memcpy to bcopy

Reviewed by:    kib, emaste
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57689
DeltaFile
+5-5sys/kern/uipc_socket.c
+5-51 files

FreeBSD/src fc9b288sys/amd64/amd64 uio_machdep.c, sys/arm/arm uio_machdep.c

uiomove_*: centralize the copy function selection

Add a uiomove_step() for the central set of switch statements which
choose between userspace and kernel and if data is going to or from the
iovec.

Refactor uiomove_fromphys loops to unconditionally free per-iteration
resources and drop gotos.

While here, switch from bcopy to memcpy.

Reviewed by:    kib
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57688
DeltaFile
+37-28sys/kern/subr_uio.c
+3-33sys/riscv/riscv/uio_machdep.c
+3-33sys/arm64/arm64/uio_machdep.c
+3-31sys/amd64/amd64/uio_machdep.c
+3-30sys/powerpc/powerpc/uio_machdep.c
+3-30sys/arm/arm/uio_machdep.c
+52-1852 files not shown
+56-2158 files

FreeBSD/src 2ee2ef6sys/amd64/amd64 pmap.c, sys/arm/arm pmap-v6.c

pmap: prefer memcpy over bcopy

Alter pmap_copy_page(s) to use memcpy rather than the deprecated bcopy.
We'll be adding non-provenance preserving versions for CHERI support and
would like to avoid introducing variants of deprecated APIs just to
maintain symmetry.

Reviewed by:    kib
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57687
DeltaFile
+5-5sys/arm/arm/pmap-v6.c
+2-2sys/arm64/arm64/pmap.c
+2-2sys/riscv/riscv/pmap.c
+1-1sys/amd64/amd64/pmap.c
+10-104 files

FreeBSD/src c57fab6sys/fs/nfsserver nfs_nfsdstate.c

nfs_nfsdstate.c: Another unnecessary initialization for gcc

This code hasn't changed in a long time, so I don't know why
this showed up now?
DeltaFile
+1-1sys/fs/nfsserver/nfs_nfsdstate.c
+1-11 files

FreeBSD/src f5fce0bsys/kern kern_exec.c

kern_exec.c: explicitly include sys/limits.h for UINT_MAX

While there, remove unneeded manual inclusion of sys/cdefs.h.

Fixes:  e1a84b7708c2 ("execve_block(): a mechanism for mutual exclusion with execve() on the process")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/kern/kern_exec.c
+1-11 files

FreeBSD/src f6b3bd1tests/sys/sound mmap.c

sound tests: Remove trailing PROT_EXEC

Fixes:          730eaf466493 ("sound tests: Add PROT_EXEC rejection test")
Reported by:    Oliver Pinter <oliver.pntr at gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      6 days
DeltaFile
+1-1tests/sys/sound/mmap.c
+1-11 files

FreeBSD/src c7e5802sys/amd64/amd64 exception.S

amd64: do not restore fsbase/gsbase for 32bit processes

There is no WRFSBASE and WRGSBASE 32bit variants at all. As such, the
fsbase and gsbase must always be equal to the bases in the corresponding
segment descriptor, same as on real i386.

If a 32bit program reloads either %fs or %gs using setcontext(9) or
sigreturn(9), restoring bases from the syscall entry time is wrong.
In all other cases, hardware already does the right action when the
segment register is loaded, and the bases for the ufssel/ugssel in GDT
are updated on the context switch.

Reviewed by:    markj (previous version)
Tested by:      terehovv at mail.ru
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57611
DeltaFile
+31-0sys/amd64/amd64/exception.S
+31-01 files

FreeBSD/src 5db31f1sys/compat/linprocfs linprocfs.c, sys/fs/procfs procfs_map.c procfs_mem.c

procfs, linprocfs: ensure target process vmspace stability

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+7-10sys/fs/procfs/procfs_map.c
+5-11sys/compat/linprocfs/linprocfs.c
+1-5sys/fs/procfs/procfs_mem.c
+13-263 files

FreeBSD/src d0384f5sys/kern kern_prot.c

sys_set*id(9): wait for the execblocks to pass

to ensure stability of the process uid/gids during the
p_cansee()/p_candebug()-protected regions.

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+10-0sys/kern/kern_prot.c
+10-01 files

FreeBSD/src e41c28esys/compat/linux linux_misc.c

linux_prlimit(): block execve for the target

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+15-0sys/compat/linux/linux_misc.c
+15-01 files

FreeBSD/src 5a91fa5sys/kern kern_proc.c

kern_proc.c: disallow execve around sysctl kern.proc.rlimit

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
DeltaFile
+16-10sys/kern/kern_proc.c
+16-101 files

FreeBSD/src 31fa677sys/kern kern_proc.c

kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vm_layout

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+10-2sys/kern/kern_proc.c
+10-21 files

FreeBSD/src 4c0a090sys/fs/pseudofs pseudofs_vnops.c

pfs_readdir(): block the target process from execing

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+9-1sys/fs/pseudofs/pseudofs_vnops.c
+9-11 files

FreeBSD/src 8367498sys/kern kern_resource.c

kern_resource.c: disallow execve around sysctl kern.proc.rlimitusage

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
DeltaFile
+19-8sys/kern/kern_resource.c
+19-81 files

FreeBSD/src 8b5abd9sys/kern kern_proc.c

kern_proc.c: disallow execve around sysctl kern.proc.kstacks

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
DeltaFile
+16-12sys/kern/kern_proc.c
+16-121 files

FreeBSD/src 80626f3sys/kern kern_proc.c

kern_proc.c: make kern.proc.osrel atomic

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+22-23sys/kern/kern_proc.c
+22-231 files

FreeBSD/src a4993basys/fs/pseudofs pseudofs_vnops.c

pseudofs: ensure that the target process vmspace is stable for VOP_READ/WRITE

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+41-18sys/fs/pseudofs/pseudofs_vnops.c
+41-181 files

FreeBSD/src 6a57292sys/kern kern_procctl.c

kern_procctl(PROC_WX_MAPPINGS_PERMIT): ensure stability of the target vmspace

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+14-7sys/kern/kern_procctl.c
+14-71 files

FreeBSD/src 79b384bsys/kern kern_event.c

kern_event: block the target process from execing for sysctl kern.proc.kqueue

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+17-5sys/kern/kern_event.c
+17-51 files

FreeBSD/src e1b0d05sys/fs/cuse cuse.c, sys/fs/procfs procfs_mem.c

proc: Allow to make proc_rwmem() operate on a consistent address space

Provide proc_vmspace_ref() to safely obtain the reference to the target
process vmspace, optionally
- requiring that the target cannot execve(2) and thus cannot change its
  vmspace until vmspace in unreferenced
- requiring the check of permissions of the caller after the vmspace
  reference is obtained, since the process lock might have been dropped
  in the process.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+107-20sys/kern/sys_process.c
+14-1sys/sys/ptrace.h
+5-5sys/kern/kern_prot.c
+2-2sys/fs/cuse/cuse.c
+1-1sys/fs/procfs/procfs_mem.c
+129-295 files

FreeBSD/src 5fe6e08sys/kern kern_proc.c

kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vmmap

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+12-8sys/kern/kern_proc.c
+12-81 files

FreeBSD/src e1a84b7sys/kern kern_exec.c kern_thread.c, sys/sys imgact.h proc.h

execve_block(): a mechanism for mutual exclusion with execve() on the process

A consumer of execve_block(9) is synchorized with the execution of
execve(2) family of syscalls, ensuring that execve_block region is
mutually exclusive with the execve processing. Either execve_block() or
execve() would sleep until other finishes.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+67-2sys/kern/kern_exec.c
+2-2sys/kern/kern_thread.c
+3-0sys/sys/imgact.h
+2-1sys/sys/proc.h
+1-0sys/kern/kern_exit.c
+75-55 files

FreeBSD/src a22c044sys/kern kern_proc.c

kern_proc.c: ensure stability of the vmspace we read the strings from

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+38-22sys/kern/kern_proc.c
+38-221 files

FreeBSD/src 450fe67sys/kern kern_exec.c, sys/sys imgact.h

execve_block_pass(9): a helper to wait for the execblock to pass

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
DeltaFile
+16-4sys/kern/kern_exec.c
+1-0sys/sys/imgact.h
+17-42 files

FreeBSD/src 9f9f0d3lib/libc/net protocols

protocols: Update with IANA list

- Update /etc/protocols with IANA list updated 2026-03-09.
- Document that 240 (pfsync) is not assigned by IANA.
- Document deprecated protocols.

PR:             295739
Reviewed by:    des
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57445

(cherry picked from commit e3fa020202d8e040242016bda275dde83c058549)
DeltaFile
+11-6lib/libc/net/protocols
+11-61 files

FreeBSD/src d661121lib/libc/net protocols

protocols: Update with IANA list

- Update /etc/protocols with IANA list updated 2026-03-09.
- Document that 240 (pfsync) is not assigned by IANA.
- Document deprecated protocols.

PR:             295739
Reviewed by:    des
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57445

(cherry picked from commit e3fa020202d8e040242016bda275dde83c058549)
DeltaFile
+11-6lib/libc/net/protocols
+11-61 files