I am trying to make a driver release, but failing (I think) because the manually generated distribution profiles are for the MacOS platform only, rather than MacOS and iOS together.
As far as I can tell, everything is correct in the manual profiles apart from the platform. The necessary entitlements appear to be correct.
In contrast, Xcode generated profiles list both MacOS and iOS as the platform and work fine for development and to generate a release archive. But Archives 'Distribute Content' gives only 'Custom' as a distribution mechanism, and no option for notarization.
So, the question is: is this a problem with my developer account (and if so, what is the appropriate channel to fix it!), or is this something subtle in the project configuration?
Post
Replies
Boosts
Views
Activity
I am getting an unexpected crash from IOService::Create() when attempting to create a new user-client. The crash is a nullptr exception in OSCopyInObjects(). The last call from my code was IOService::Create().
As far as I can tell, all the input parameters to Create() are correct, and the Info.plist is has the correct key and class information - indeed, if I corrupt these I get an error status return rather than a crash.
Any suggestions as to what could be causing this?
I suspect that the problem may be related from a change in the underlying application that is creating the user client. This was modified from a standard app to a daemon, following the advice here: https://developer.apple.com/documentation/xcode/signing-a-daemon-with-a-restricted-entitlement.
However, it is the driver that crashes - not the host opening the user client.
On macOS 10.15, if the user does the following:
install version 1 of an app to /Applications and activate an embedded driverkit system extension
copy a newer version 2 of the app & extensions to /Applications, overwriting the original
when the version 2 app tries to activate its updated extension, it gets the error OSSystemExtensionErrorUnknown. Furthermore the user can not delete the app, as the finder now hangs when it tries to deactivate the extensions - presumably because the copy has damaged the original installation. Similarly, "systemextensionctl uninstall" also hangs.
As far as I know, the only ways to recover are: issue the shell command "systemextensionctl reset", which is a bit drastic
force-quit the Finder, reboot and then delete the app before reinstalling and running
Any suggestions as to how to work around this? I have tried to issue an explicit deactivation request from the updated app, but unsurprisingly this also fails with ErrorUnknown.
With kexts, macOS would evaluate all candidate drivers and then load the most appropriate for the hardware.
But with dexts, what I observe is that all matching drivers are started. So for example, if I create two distinct dexts that will match to a USB device, both are loaded as well as any kext that also matches the device. This means that it appears to be impossible to implement the equivalent as a codeless kext in DriverKit.
How can I avoid this race condition, and ensure that the dext takes priority over a kext?
FWIW, in the specific case we have an external device that when placed in to an update mode gets assigned to the macOS Bluetooth driver (macOS 11.2 kext), which then try to use it as a wireless adapter. This stops our app from running and also breaks the Mac's Bluetooth connections in the process. We want to stop the Bluetooth stack from binding to this device.
I need to migrate functionality previously implemented in a kext probe() function to DriverKit. However, I am unable to find an equivalent method.
The probe() method was used to tighten the matching criteria over that possible with the Info.plist, by performing additional checks on USB configuration data.
I can implement this in the driver's Start() method, returning an error if the additional USB checks fail. However, this appears to leave the driver instance in a broken state - for example, the driver's free() method is never called to release resources allocated in init().
What is the correct way to implement probe() functionality in DriverKit?