FreeBSD/src 8e61d87cddl/contrib/opensolaris/lib/libdtrace/common dt_consume.c

libdtrace: Fix dt_print_sym() not printing symbols in non-oformat mode

dt_print_sym() fills the symbol string via snprintf() in non-oformat
mode but the guarding `dtp->dt_oformat != 0 &&` for the dt_printf()
call causes the symbol is computed but never emitted.

This fixes tests:

- common.profile-n.t_dtrace_contrib.tst_sym_ksh
- common.profile-n.t_dtrace_contrib.tst_func_ksh

Reviewed by:    markj
Fixes:          93f27766a7e1 ("dtrace: Add the 'oformat' libdtrace option")
MFC after:      3 days
Event:          Halifax Hackathon 202606
Location:       Room 208, Computer Science Building, Dalhousie University
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57895
DeltaFile
+1-1cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
+1-11 files

FreeBSD/src a380d07usr.sbin/virtual_oss/virtual_oss virtual_oss.8

virtual_oss.8: Document `/dev/bluetooth/` prefix magic

Without this one could be led to believe they should have an actual
`/dev/bluetooth/xxx` device in devfs from just reading the examples.

Event:          Halifax Hackathon 202606
Reviewed by:    christos
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57818

(cherry picked from commit 7ecd9afd3b28b9e1a112b5925a8f5902e121b128)
DeltaFile
+22-1usr.sbin/virtual_oss/virtual_oss/virtual_oss.8
+22-11 files

FreeBSD/src a6d7347usr.sbin/virtual_oss/virtual_oss virtual_oss.8

virtual_oss.8: Use `.Pa` macro to refer to devices

Suggested by:   christos
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days

(cherry picked from commit 31461c8bc9c16004feae9cc17b89fd5213a09ae0)
DeltaFile
+16-7usr.sbin/virtual_oss/virtual_oss/virtual_oss.8
+16-71 files

FreeBSD/src 0d4b73alib/libc/gen ctermid.c

ctermid(3): Fix return

Reported by:    bnovkov
Fixes:  dc24f31b67f5 ("ctermid(3): Fix return values section")
Sponsored by:   Klara, Inc.

(cherry picked from commit d7c110658e0b11fbe7a1f5d9f2b340d1985b9742)
DeltaFile
+1-1lib/libc/gen/ctermid.c
+1-11 files

FreeBSD/src 3d6a475lib/libc/gen ctermid.3 ctermid.c

ctermid(3): Fix return values section

ctermid() doesn't, and has never, set errno.

While here, add ctermid_r to the name section and align the parameter
name in the source file.

Reviewed by:    bnovkov
Approved by:    bnovkov
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57396

(cherry picked from commit dc24f31b67f5b0bac35cb93470f6f2d065d99f6f)
DeltaFile
+15-10lib/libc/gen/ctermid.3
+7-7lib/libc/gen/ctermid.c
+22-172 files

FreeBSD/src e1f80e4lib/libc/gen daemon.3

daemon(3): Note about environment after calling daemon()

While here, fix missing comma typo.

Reviewed by:    0mp, ziaee
Approved by:    0mp, ziaee
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc (partially)
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57384

(cherry picked from commit bb14ba3777bb201abd6d4dfbf67d70b81f9c1e97)
DeltaFile
+24-2lib/libc/gen/daemon.3
+24-21 files

FreeBSD/src 2b51bd5share/man/man4 ntsync.4 Makefile

ntsync.4: add the man page

(cherry picked from commit f6b37f47c09903413bd980a5ebd4c7c3e19ba8a5)
DeltaFile
+308-0share/man/man4/ntsync.4
+1-0share/man/man4/Makefile
+309-02 files

FreeBSD/src 4d3cbebsys/netgraph ng_socket.c

ng_socket: plug node reference leak

There is no need to reference node in its constructor, the framework
already granted us a reference.  This extraneous reference was later given
back on socket detach.  However, if node is destroyed before the socket,
the node was leaked.  This leak was harmless until VIMAGE, where
vnet_netgraph_uninit() would cycle through all nodes and shut them down
expecting them to not exist after the shutdown.

Fixes: 19284374970533e1aa04020d4f840e8877ed6266
DeltaFile
+0-2sys/netgraph/ng_socket.c
+0-21 files

FreeBSD/src 41bc52csys/netgraph ng_socket.c

ng_socket: simplify protosw(9) methods

- so_pcb can't be non-NULL in pr_attach.
- so_pcb can't be NULL in all other methods.
- Short circuit data socket attach down to the common attach.
- Short circuit both detach methods down to common one.
- Inline control socket attach.
- Inline control pr_bind.
- Inline data pr_connect.
- Rely on pr_connect_notsupp() for control connect(2).
- Don't use cast on so_pcb, it is void *.

Should be no functional change.
DeltaFile
+25-107sys/netgraph/ng_socket.c
+25-1071 files

FreeBSD/src 830d739stand/efi/include ipxe_download.h

loader.efi: polish SPDX header

Fixes:          afee781523e45198c7be0a19281bcae2c4ab66db
DeltaFile
+1-1stand/efi/include/ipxe_download.h
+1-11 files

FreeBSD/src 1fc6923tools/boot universe.sh

loader: Test GCC cross builds as part of universe.sh

Sicne we have gcc15 in Jenkins, and since people are actually using it,
add cross building tests to universe.sh to avoid build breakage when
hacking on loader.efi (and others). UEFI makes it too easy to mix
pointers and integers since it deals in an odd mix of
EFI_PHYSICAL_ADDRESS and pointers...

Sponsored by:           Netflix
DeltaFile
+10-0tools/boot/universe.sh
+10-01 files

FreeBSD/src 9cb1459stand/efi/loader decompress.c

loader.efi: Fix build with gcc due to pointer / int issues on 32-bit build

Use (uintptr_t) casts to cast the EFI_PHYSICAL_ADDDRESS to a pointer.

Fixes: afee781523e4 ("loader.efi: Recognize new memdisk=<url> and memcd=<url> options")
Sponsored by:           Netflix
Reviewed by:    rlibby
Differential Revision:  https://reviews.freebsd.org/D57893
DeltaFile
+8-8stand/efi/loader/decompress.c
+8-81 files

FreeBSD/src 9de06f2lib/libpfctl libpfctl.c

libpfctl: fix memory leak

When we snl_init_writer() we allocate memory in the struct snl_state in the struct pfctl_handle.
This memory was never released again, leading to a memory leak. We still
had a reference to the memory and would release it on pfctl_close()
(so valgrind did not detect it as a leak), but long-lived users (e.g.
bsnmpd) would eventually run out of memory.

Explicitly reset the snl_state when we're done to prevent this.

MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit fcb31b57112425a4eb64241651a0206108105298)
DeltaFile
+308-126lib/libpfctl/libpfctl.c
+308-1261 files

FreeBSD/src f95439flib/libpfctl libpfctl.c

libpfctl: retrieve family id only once

Look up the pfctl family id when we open the handle, rather than for
every function call.
This saves us a lot of netlink calls, at the expense of storing one
extra int in the handle.

Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 2a478dfc7f9cd60037939e121026bf26a01e8c41)
DeltaFile
+68-192lib/libpfctl/libpfctl.c
+68-1921 files

FreeBSD/src 5b8c28asbin/ping/tests test_ping.py

ping/tests: expect bell chars from stderr after initial status

After 141bb85798 and 8bda488114f3, ping(8) first writes and flushes the
initial status to stdout, then writes notification bell characters to stderr.

This patch corrects the expected order of the output to stdout and stderr.
This is a temporary fix; the test should be rewritten to separate the output
streams and run expectations on each individually.

Reviewed by:    des
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
DeltaFile
+4-4sbin/ping/tests/test_ping.py
+4-41 files

FreeBSD/src 42d8b0bsys/kern kern_exec.c

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

(cherry picked from commit f5fce0bcc370a9700249e64901eabf2e0be4ecb0)
DeltaFile
+1-1sys/kern/kern_exec.c
+1-11 files

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

procfs, linprocfs: ensure target process vmspace stability

(cherry picked from commit 5db31f1b47b586a5091eb41fc957236f28b78dba)
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 e049244sys/kern kern_prot.c

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

(cherry picked from commit d0384f50dad25d3358d76f7556969ea1d515ba68)
DeltaFile
+10-0sys/kern/kern_prot.c
+10-01 files

FreeBSD/src 1744ce4sys/fs/pseudofs pseudofs_vnops.c

pfs_readdir(): block the target process from execing

(cherry picked from commit 4c0a0909f928baac982b7de4bfa5b5ca7de5291a)
DeltaFile
+9-1sys/fs/pseudofs/pseudofs_vnops.c
+9-11 files

FreeBSD/src e900223sys/compat/linux linux_misc.c

linux_prlimit(): block execve for the target

(cherry picked from commit e41c28e67fac9cd22a85b160c5c9d0477ed03600)
DeltaFile
+15-0sys/compat/linux/linux_misc.c
+15-01 files

FreeBSD/src 277f612sys/fs/pseudofs pseudofs_vnops.c

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

(cherry picked from commit a4993bac41350e85bc9affb862d2974a1a09bb5e)
DeltaFile
+41-18sys/fs/pseudofs/pseudofs_vnops.c
+41-181 files

FreeBSD/src 035f66fsys/kern kern_resource.c

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

(cherry picked from commit 836749817036b90b60af0584fa21f2d9dbd60ff7)
DeltaFile
+19-8sys/kern/kern_resource.c
+19-81 files

FreeBSD/src d80a7fdsys/kern kern_procctl.c

kern_procctl(PROC_WX_MAPPINGS_PERMIT): ensure stability of the target vmspace

(cherry picked from commit 6a572920f251ac8ac6a80a55d4d039736ea7dd65)
DeltaFile
+14-7sys/kern/kern_procctl.c
+14-71 files

FreeBSD/src d172933sys/kern kern_event.c

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

(cherry picked from commit 79b384bd8fdff4869ce4799edb0342ff5c25b6fa)
DeltaFile
+17-5sys/kern/kern_event.c
+17-51 files

FreeBSD/src 60d8df6sys/kern kern_proc.c

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

(cherry picked from commit 8b5abd9027b8b1f6290c756730ee3adebed007f4)
DeltaFile
+16-12sys/kern/kern_proc.c
+16-121 files

FreeBSD/src 24d8b33sys/kern kern_proc.c

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

(cherry picked from commit 5a91fa5a7656c99e527fe7e6f6bf6bd9e85ab589)
DeltaFile
+16-10sys/kern/kern_proc.c
+16-101 files

FreeBSD/src 5e633dbsys/kern kern_proc.c

kern_proc.c: make kern.proc.osrel atomic

(cherry picked from commit 80626f34ee985671bb8c60ee986b89587b7a1511)
DeltaFile
+22-23sys/kern/kern_proc.c
+22-231 files

FreeBSD/src eb03358sys/kern kern_proc.c

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

(cherry picked from commit 31fa677e4af00b795bf671847b4dc72960c90f14)
DeltaFile
+10-2sys/kern/kern_proc.c
+10-21 files

FreeBSD/src 20ed389sys/kern kern_proc.c

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

(cherry picked from commit 5fe6e08d2db56b530f0df2903ef24cfabab7b8ea)
DeltaFile
+12-8sys/kern/kern_proc.c
+12-81 files

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

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

(cherry picked from commit e1b0d051bbf7e4e730470cbd6622f71a639834c3)
DeltaFile
+109-22sys/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
+131-315 files