You can use the I / O set properties mechanism to exchange plist-like data between user space and kernel space. To install them from user space, you want to use one or more of the following IOKitLib functions:
IORegistryEntrySetCFProperty
IORegistryEntrySetCFProperties
IOConnectSetCFProperty
IOConnectSetCFProperties
On the kernel side, your subclass of IOService or IOUserClient should override the function virtual IOReturn setProperties( OSObject * properties );
. Remember to process any data received as potentially hostile, so make sure that you check nullptr
s, use OSDynamicCast()
while waiting for a specific OSData
/ OSNumber
/ OSString
/ OSArray
/ etc. objects and sanitize the data itself.
, setProperties()
IORegistryEntry
, this->setProperty()
/ .
Apple .