Gurus, I implemented a kauth FileScope listener to monitor some file activity and report to a user mode daemon some stuff.
The way I did it was to catch the file event (either KAUTH_FILEOP_OPEN or KAUTH_FILEOP_CLOSE, doesn't matter), check whether this operation is on file/folder I need to monitor and if yes, send some data to the usermode daemon using ctl_enqueuedata()...
Well, if I do that, *any* process that accesses this file or folder, gets stuck in _exit() for no apparent reason (before exitting, all processes read and write data to the monitored file seamlessly).
The data I sent via the call, gets through to the daemon correctly and the daemon itself is not stuck at all.
If I comment out the ctl_enqueue() call, everything works fine.
Does any one have an idea what might be the problem here? It doesn't help wrapping the ctl_enqueue() with locks... Same thing.
Thanks a lot
Misha