DragonFlyBSD/src d8b4bdfsys/kern subr_diskmbr.c subr_diskslice.c

kernel: Clean up subr_diskmbr.c and subr_diskslice.c

No functional changes.
DeltaFile
+77-82sys/kern/subr_diskslice.c
+8-14sys/kern/subr_diskmbr.c
+85-962 files

DragonFlyBSD/src 2b3ac52initrd/oinit oinit.c pathnames.h

initrd/oinit: Fold pathnames.h into oinit.c

Meanwhile, remove unused _PATH_RUNDOWN define.
DeltaFile
+0-39initrd/oinit/pathnames.h
+2-1initrd/oinit/oinit.c
+2-402 files

DragonFlyBSD/src 8eea1a0etc/rc.d routed route6d

rc.d: Clean up routed and route6d scripts

* Remove obsolete comments.
* Replace 'eval' with assignment to 'command_args' variable.
DeltaFile
+2-7etc/rc.d/route6d
+2-6etc/rc.d/routed
+4-132 files

DragonFlyBSD/src d0e023aetc/rc.d devfs

rc.d: Skip 'devfs' in jails

Obtained-from: FreeBSD
DeltaFile
+1-0etc/rc.d/devfs
+1-01 files

DragonFlyBSD/src 75a978dshare/man/man4 netintro.4

netintro.4: Fix whitespace and indentation for 'struct sockaddr'
DeltaFile
+3-3share/man/man4/netintro.4
+3-31 files

DragonFlyBSD/src 4fb785dlib/libtcplay safe_mem.c, sbin/cryptdisks safe_mem.c

libtcplay,cryptdisks: Fix GCC 12's -Wmaybe-uninitialized false positive

This reverts commit b77d373551e67a9ce62d8063b8dd7bafd6f9e360 and
correctly fix/silence the GCC 12's -Wmaybe-uninitialized warning, which
is actually a false positive.

GCC's rationale is: the memory 'mem' refers to was not initialized and
may be used in mlock(). The 'mem' parameter is passed as 'const void *',
so mlock() is impossible to initialize the memory.

Discussed-with: swildner
See-also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118588#c1
DeltaFile
+6-10sbin/cryptdisks/safe_mem.c
+6-10lib/libtcplay/safe_mem.c
+12-202 files

DragonFlyBSD/src 38407b1usr.sbin/jail jail.8

jail.8: Document jail.defaults.vfs_mount_* MIB entries
DeltaFile
+25-1usr.sbin/jail/jail.8
+25-11 files

DragonFlyBSD/src f7d736asys/conf kern.pre.mk

kern.pre.mk: Style cleanups
DeltaFile
+7-5sys/conf/kern.pre.mk
+7-51 files

DragonFlyBSD/src 0688f9fsys/vm device_pager.c

vm: Clean up cdev_pager_allocate() a bit

* Introduce 'pindex' variable to clean up the code.
* Add KASSERT() to ensure the object type matches (obtained from FreeBSD)
DeltaFile
+7-4sys/vm/device_pager.c
+7-41 files

DragonFlyBSD/src 3afd77dshare/man/man7 vkernel.7

vkernel.7: Fix markup in FILES section
DeltaFile
+1-2share/man/man7/vkernel.7
+1-21 files

DragonFlyBSD/src 86716f0sys/vm device_pager.c

vm: Remove duplicate reference in cdev_pager_allocate()

The code was updated in 2013 [1] to bring in various changes from
FreeBSD, but left this duplicate reference.  Remove the erroneous
vm_object_reference_locked() call.

[1] kernel: Port new device_pager interface from FreeBSD
    commit f2c2051ee473577d22178d55f782ceebbd88d58f

GitHub-PR: #49
Credit: LI Leding
DeltaFile
+0-4sys/vm/device_pager.c
+0-41 files

DragonFlyBSD/src f47a9aesys/platform/vkernel64/conf Makefile ldscript.x86_64

vkernel64: Remove unused linker script
DeltaFile
+0-194sys/platform/vkernel64/conf/ldscript.x86_64
+3-0sys/platform/vkernel64/conf/Makefile
+3-1942 files

DragonFlyBSD/src 2e3d5fesys/net/wg if_wg.c

wg: Destroy newly created peers on failure

Previously, a newly created peer was not destroyed even if there were
errors in configuring it, e.g., invalid AllowedIPs.  The rationale was
that the user could correct the error by issuing another 'ifconfig'
command with the fixed arguments.

Now destroy the new peer if an error occurs, making a complex 'ifconfig'
command that adds a peer atomic.  This matches the behavior of FreeBSD.

As part of this change, refactor wg_ioctl_set() by extracting
wg_ioctl_set_peer() to handle a single peer, and add  'const' qualifiers
where appropriate.
DeltaFile
+92-73sys/net/wg/if_wg.c
+92-731 files

DragonFlyBSD/src 4a85e64sys/kern kern_mib.c

kernel: Disable build-ID for vkernel(7) and fix build

Vkernel(7) doesn't use a linker script, so it's not easy to define
__build_id_{start,end} for it.

A solution would be to locate the ELF in memory, parse and walk the
program headers to find the ".note.gnu.build-id" section.

Reported-by: Michael Neumann
DeltaFile
+9-0sys/kern/kern_mib.c
+9-01 files

DragonFlyBSD/src d4a2200sys/conf kern.pre.mk, sys/platform/vkernel64/conf Makefile

kern.pre.mk: Update ELDFLAGS and thus clean up vkernel64/Makefile
DeltaFile
+4-12sys/platform/vkernel64/conf/Makefile
+8-8sys/conf/kern.pre.mk
+12-202 files

DragonFlyBSD/src 44d8901sys/net/wg if_wg.c

wg: Merge the code of handling SIOC[SG]WG ioctls

This cleans up the caps_priv_check() code.
DeltaFile
+9-9sys/net/wg/if_wg.c
+9-91 files

DragonFlyBSD/src 70b4e2bsys/net/wg if_wg.c

wg: Return ENETUNREACH when transmitting to a non-existent peer

Do the same thing as FreeBSD and OpenBSD.

Obtained-from: FreeBSD (https://reviews.freebsd.org/D44582)
DeltaFile
+1-5sys/net/wg/if_wg.c
+1-51 files

DragonFlyBSD/src 8adc752sys/net/wg if_wg.c

wg: Do not expose peer information to jail
DeltaFile
+10-4sys/net/wg/if_wg.c
+10-41 files

DragonFlyBSD/src e8b4e7bshare/man/man4 amdsbwd.4

amdsbwd.4: update for FCH watchdogs
DeltaFile
+21-5share/man/man4/amdsbwd.4
+21-51 files

DragonFlyBSD/src ce53cbbsys/dev/misc/amdsbwd amd_chipset.h amdsbwd.c

amdsbwd: add EFCH MMIO PM access for Zen
DeltaFile
+83-19sys/dev/misc/amdsbwd/amdsbwd.c
+3-0sys/dev/misc/amdsbwd/amd_chipset.h
+86-192 files

DragonFlyBSD/src a5e541ausr.bin/rpcinfo rpcinfo.c

rpcinfo(8): Fix stack buffer overflow in rpcbdump()

The function previously used unbounded sprintf() and strcat() to format
the info into a fixed 256-byte stack buffer.  A malicious or compromised
rpcbind endpoint that returns enough distinct version numbers for a
single program (roughly 24 maximum-width decimal values plus separators)
can overflow this buffer.

CVE: CVE-2026-16461
Openwall: CVE-2026-16277 & CVE-2026-16461: buffer overflows in rpcinfo
        (https://www.openwall.com/lists/oss-security/2026/07/23/8)
DeltaFile
+16-7usr.bin/rpcinfo/rpcinfo.c
+16-71 files

DragonFlyBSD/src 41a496cusr.bin/rpcinfo rpcinfo.c

rpcinfo(8): Fix stack buffer overflow in rpcbaddrlist()

rpcinfo's rpcbaddrlist() formats two server-controlled, unbounded XDR
strings into a fixed 128-byte stack buffer with sprintf(). A malicious
or on-path rpcbind server overflows it when a user runs:
$ rpcinfo -l <host> <prognum> <versnum>

Obtained-from: https://git.linux-nfs.org/?p=steved/rpcbind.git;a=commitdiff;h=bb9bb7286a4c345442946dc2ce3c9e7f67e96d4d
CVE: CVE-2026-16277
Openwall: CVE-2026-16277 & CVE-2026-16461: buffer overflows in rpcinfo
        (https://www.openwall.com/lists/oss-security/2026/07/23/8)
DeltaFile
+1-1usr.bin/rpcinfo/rpcinfo.c
+1-11 files

DragonFlyBSD/src c5c76d9sys/kern kern_linker.c

kernel/linker: serialize recursive unload

Restore the safe list traversal from commit
e7a2d40362352344eff1c4f395caf0a735e00a3e.

'llf_lock' is now recursive and held through the unload path, so
callbacks and dependency release can recurse without exposing a
partially unloaded file.

GitHub-PR: #50
DeltaFile
+4-8sys/kern/kern_linker.c
+4-81 files

DragonFlyBSD/src e8a1da7sys/kern kern_linker.c

kernel/linker: preserve refs after unload veto

linker_file_unload() used to take a temporary file reference (file->refs)
before notifying modules to unload [1].  Its veto path dropped that
temporary reference before returning the error.

The 2009 linker code sync with FreeBSD [2] removed the temporary
reference but retained the decrement.  Therefore, every failed kldunload
reduced 'file->refs' even though the file remained loaded, allowing
repeated EBUSY returns to drive the count below zero.

Keep the existing reference when a module vetoes unload.  sys_kldunload()
already restores userrefs on error, and a later unload attempt can retry
with both counters unchanged.

[1] Handle recursive situations a bit more robustly ...
    commit e7a2d40362352344eff1c4f395caf0a735e00a3e
[2] modules: pull in most of FreeBSD's module linker changes
    commit 1c0e32863e0583221e430c22c1c68a023fd16195

    [2 lines not shown]
DeltaFile
+0-1sys/kern/kern_linker.c
+0-11 files

DragonFlyBSD/src 4411524sys/kern subr_diskslice.c, sys/sys param.h diskslice.h

kernel: Remove DIOCGSLICEINFO and DIOCSYNCSLICEINFO ioctls

The DIOCGSLICEINFO ioctl code had a buffer overflow bug.  The ioctl
declared the parameter to have size of 'struct diskslices', which only
supported MAX_SLICES (i.e., 16) slices.  When try to use this ioctl on a
disk with more slices (e.g., a GPT disk that may have 128
partitions/slices), the bcopy() would overflow the target buffer that
was prepared by mapped_ioctl().

It's actually not easy to properly fix this bug. However, this ioctl was
actually unused. In addition, FreeBSD has removed it in 2003 [1]. So
simply remove it, together with the related DIOCSYNCSLICEINFO.

[1] https://github.com/freebsd/freebsd-src/commit/19f7043db0bba9dd2c333612eff90411339d46de

GitHub-PR: #43
Reported-by: Nathan Sapwell (jewbird)
Discussed-with: swildner
DeltaFile
+0-35sys/kern/subr_diskslice.c
+2-2sys/sys/diskslice.h
+2-1sys/sys/param.h
+4-383 files

DragonFlyBSD/src ed140d8sys/kern subr_diskmbr.c

kernel: Do not log MBR missing for device mapper and CD

MBR are expected to be missing for such devices, so no need to report
it.
DeltaFile
+6-2sys/kern/subr_diskmbr.c
+6-21 files

DragonFlyBSD/src 4ef1a3asys/kern kern_caps.c

kernel: Fix jail caps check bug in caps_priv_check()

caps_priv_check() reuses its cap parameter to hold the
group-shifted value before passing it to prison_priv_check(), so the
per-capability jail cases (SYSCAP_NONET_RAW, SYSCAP_NOMOUNT_*,
SYSCAP_NOMOUNT_PROCFS, etc.) are never evaluated.  The group caps
SYSCAP_NONET / SYSCAP_NOMOUNT always return 0 in jail, so raw sockets
and null/tmp/dev/procfs mounts succeed inside a default-policy jail.

Fix the bug by using a separate local variable for the group check.

GitHub-PR: #44
Assisted-with: Zhipu GLM-5.2
DeltaFile
+3-3sys/kern/kern_caps.c
+3-31 files

DragonFlyBSD/src a0bf740sys/net/tun if_tun.c

if_tun: Fix mbuf chain leak in tunwrite()

tunwrite() builds an mbuf chain headed by 'top' in its read loop;
on the final iteration the local 'm' points at the chain tail.
Then the subsequent EAFNOSUPPORT default case of the family switch calls
m_freem(m), freeing only that tail mbuf and leaking the chain head and
all intermediates.

Fix the m_freem() to free from 'top' instead to free the whole mbuf
chain, matching the earlier error path.

While there, fix one indentation. (aly)

GitHub-PR: #39
Assisted-with: Zhipu GLM-5.2
DeltaFile
+2-2sys/net/tun/if_tun.c
+2-21 files

DragonFlyBSD/src 90dd181sys/net if.c

net: Fix SIOCSIFDESCR fallthrough bug in ifioctl()

* Add the missing 'break' to SIOCSIFDESCR to fix the fallthrough bug.
* Remove the redundant ifnet_lock()/unlock() pair.
* Clean up the code a bit by rearranging the local variables.
DeltaFile
+11-8sys/net/if.c
+11-81 files

DragonFlyBSD/src f5f3e1fsys/net if.c

net: Fix ifnet_mtx deadlock in ifioctl()

Several error paths in ifioctl()'s switch (SIOCGIFGROUP, SIOCAIFGROUP,
SIOCDIFGROUP, SIOCSIFDESCR) return directly instead of break, bypassing
the ifnet_unlock() at the end of the function.  As a result, ifnet_mtx
is held across the switch and will block any future ifnet_lock() calls,
which basically breaks the network subsystem.

What makes matter worse is that SIOCGIFGROUP has no caps check, so
any local user can trigger such a deadlock in the network subsystem.

GitHub-PR: #47
Assisted-with: Zhipu GLM-5.2
DeltaFile
+10-12sys/net/if.c
+10-121 files