I'm finding a way to hook vnode operations, following is a snippet of the code:
IOReturn
FltIOKitKAuthVnodeGate::RegisterVnodeScopeCallback(void)
{
//
// register our listener
//
this->VnodeListener = kauth_listen_scope( KAUTH_SCOPE_VNODE, // for the vnode scope
FltIOKitKAuthVnodeGate::VnodeAuthorizeCallback, // using this callback
this ); // give a cookie to callback
if( NULL == this->VnodeListener ){
DBG_PRINT_ERROR( ( "kauth_listen_scope failed\n" ) );
return kIOReturnInternalError;
}
return kIOReturnSuccess;
}
Here use kauth_listen_scope to get the newly created vnode object, then will hook on it.
But now kauth_listen_scope is deprecated, and there is no way to get the vnode by using EndpointSecurity.
So is there any other way to get the newly created vnode object?
do you think it's a good idea to borrow from the implementation of Linux 3rd file system FUSE?
If I were to port Linux FUSE to VFS, what would be the biggest challenges and differences?
I don’t have any opinions on these because I don’t have any direct experience with the Linux VFS abstraction. Sorry.
If I were in your shoes I’d find a better project to work on (-: Or, if you have to build this, come up with a way to work within macOS’s constraints. A VFS plug-in is unlikely to yield a reliable long-term product.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"