Post

Replies

Boosts

Views

Activity

"Bad code signature" happens during kext installation.
Hi there, While developing my first kernel extension for a learning purpose, I'm facing the issue above, "Bad code signature". The actual steps to reproduce are as follows: \ Initialize my Xcode project using the template "Generic Kernel Extension". Implement a fundamental extension that displays "Hello World!" using printf();. Build and sign it as "Sign to run locally". Put the "HelloWorld.kext" bundle into the /Library/Extensions/. Change the owner of the bundle file to "root:wheel". Load the extension using as follows. $ cd /Library/Extentions $ sudo kextload /Library/Extensions/HelloWorld.kext Password: Executing: /usr/bin/kmutil load -p /Library/Extensions/HelloWorld.kext Error Domain=KMErrorDomain Code=29 "Authenticating extension failed: Kext com.martymarron.HelloWorld v.1.0.0 in executable kext bundle com.martymarron.HelloWorld at /Library/Extensions/HelloWorld.kext: Authenticating extension failed: Bad code signature" UserInfo={NSLocalizedDescription=Authenticating extension failed: Kext com.martymarron.HelloWorld v1.0.0 in executable kext bundle com.martymarron.HelloWorld at /Library/Extensions/HelloWorld.kext: Authenticating extension failed: Bad code signature} I guessed that the bundle needs to be signed anyway. Hence I signed it for "development", but it resulted in the same. Some article says that my developer account should be enabled for "KEXT development" on https://developer.apple.com/resources/developer-id/, but this link does not work now. Referred article: https://developer.apple.com/forums/thread/30703 Then, I found the article below says "the kernel doesn't load a kext if an equivalent System Extention solution exists". https://developer.apple.com/documentation/kernel/implementing_drivers_system_extensions_and_kexts Does this mean the kernel extension development on my environment is no longer supported? Or is there still the way to try the kernel extension development on my environment? If no, I'll give up trying it and will try "system extension development" instead. Thanks for your kind help! My development environment: OS ver: Monterey(12.5) CPU Arch: Intel Core i7 Xcode ver: Version 13.4.1 (13F100)
4
0
2.5k
Aug ’22