[DragonFlyBSD - Bug #3467] (New) kernel: Panic in cache_fullpath() when unmounting / at shutdown

tuxillo bugtracker-admin at leaf.dragonflybsd.org
Tue Nov 10 08:58:29 PST 2026


Issue #3467 has been reported by tuxillo.

----------------------------------------
Bug #3467: kernel: Panic in cache_fullpath() when unmounting / at shutdown
http://bugs.dragonflybsd.org/issues/3467

* Author: tuxillo
* Status: New
* Priority: Normal
* Target version: 6.6
* Start date: 2026-11-10
----------------------------------------
As of 6.5-DEVELOPMENT (v6.5.0.2152.g732cbb) my desktop panicked on reboot
while unmounting /:

<pre>
Fatal trap 12: page fault while in kernel mode
cpuid = 0; lapic id = 0
fault virtual address   = 0x88
fault code              = supervisor write data, page not present
instruction pointer     = 0x8:0xffffffff806e413b
current process         = 1
[...]
calltrap() at calltrap+0x9 0xffffffff80bb372a
--- trap 000000000000000c, rip = ffffffff806e413b, rsp = fffff80266cfe680, rbp = fffff80266cfe6a8 ---
cache_drop() at cache_drop+0x1b 0xffffffff806e413b
cache_fullpath() at cache_fullpath+0x6a 0xffffffff806ecb8a
</pre>

kgdb on the dump shows the rest: mount_warning(), dounmount(),
vfs_unmountall(), boot(), sys_reboot().

It comes from 0fe12bb8d3 ("Fix cache_fullpath() races in procfs").
cache_fullpath() now wraps the walk in cache_copy()/cache_drop().
cache_copy() is fine with a NULL ncp but cache_drop() isn't (nc_refs is
at 0x88). The root mount's mnt_ncmounton is {NULL, NULL}, so any
mount_warning() on / panics now. Before that commit mount_warning() just
printed the mp pointer in that case.

That commit switched the identical cache_fullpath(NULL,
&mp->mnt_ncmounton, ...) call in vfs_getnewfsid() to
cache_fullpath_refd(), but missed the one in mount_warning()
(vfs_syscalls.c:1141). Still the same on master.

Here it was the forced unmount warning, because / still had an extra
mount ref after the retries. That ref came from a leaked struct file,
which is a separate bug in sys_fchdir().

Fix should be to use cache_fullpath_refd() in mount_warning(), where the
mount is locked. Maybe also have cache_fullpath() skip the copy/drop on a
NULL ncp so other callers can't hit this. Disks were synced before the
panic, so nothing was lost.



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list