Accessing a directory on my custom distributed filesystem results in a kernel panic.
According to the backtrace, the last function called before the panic is triggered is mac_label_verify().
See the backtrace file attached.
The panic manifests itself given the following conditions:
- Machine-a: make a directory in Finder.
- Machine-b: remove the directory created on machine-a in Finder.
- Machine-a: access the directory removed on machine-b in Finder. Kernel panic ensues.
The panic is reproducible on both Apple Silicon and x86-64.
The backtrace is for x86-64 as I wasn't able to symbolicate it on Apple Silicon.
Not sure how to tackle this one.
Any pointers would be much appreciated.
Regrettably, VNOP_MONITOR is off limits to 3rd party filesystems, as it's a XNU_KERNEL_PRIVATE symbol.
No, or at least not exactly.
You're right that "VNOP_MONITOR" is marked XNU_KERNEL_PRIVATE, but that's because most of the "VNOP_*" defines are marked that way. That includes basic (and critical) operations line "VNOP_OPEN". That's because the VFS API is structured and documented as:
-The "VNOP_*" functions are the functions the VFS system itself "calls" into. For example, here is a call to VNOP_MONITOR inside the VFS implementation.
-Every "VNOP_*" function is actually implemented as a wrapper function to a function pointer your VFS driver provides. Here's the implementation of VNOP_MONITOR inside kpi_vfs.c.
-Every "VNOP_*" function has a corresponding argument structure and descriptor, which are what your vfs driver actually implement. You can find them just above the entry for the "VNOP_" definition.
-Those are what your vfs actually implement. Here's the structure entry in smbfs and the actual function call that implements the actual vnop.
The basic structure above is how most of the VNOP functions are marked and with the (very) OCCASIONAL exceptions being VNOPs that are considered "useful" outside of the vfs layers internal implementation.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware