I need to disable access to certain devices (the built-in FaceTime Camera, for example), and have been trying to do so by providing a simple kext with a higher probe score than what is currently attached.
My kext matches and attaches to the camera as both IOProviderClass IOUSBInterface
and IOProviderClass IOUSBDevice
, but all of the original kexts still attach to it as well. This is how it looks in IORegistryExplorer:
FaceTime HD Camera (Built-in)@14700000 # USB device
+-- FaceTime HD Camera (Built-in)@0 # USB interface
| +-- FaceTimeDisabler # my kext matching as IOUSBInterface
| +-- IOUSBInterfaceUserClientV3 # original
+-- IOUSBDeviceUserClientV2 # original
+-- IOUSBInterface@1 # original
| +-- IOUSBInterfaceUserClientV3 # original
+-- IOUSBInterface@2 # original
+-- FaceTimeDisabler # my kext matching as IOUSBDevice
I thought the point of device and driver matching was to select a single kext to attach to the device, so I expected that if my kext matched with the highest probe score, it would gain exclusive control of the device, but that clearly isn't the case.
My questions are these:
- How can I ensure that my kext gains exclusive access to a device?
- If there is a better approach to disable access to a device, what is it?