During the release of our macOS App, we encountered the following issue:
We need to support dynamic code loading of WebAssembly (wasm) inside our App, mainly by loading WebAssembly (wasm) binary modules.
We discovered a problem: a wasm file is neither an executable nor a bundle, so it cannot be code-signed. Since our App needs to pass notarization, we have not set the com.apple.security.cs.allow-unsigned-executable-memory entitlement.
Without setting com.apple.security.cs.allow-unsigned-executable-memory, loading a wasm module results in an “unsigned code” error that causes the process to crash.
Could you please advise on what we should do to avoid this problem? Is it possible to apply for a special entitlement to allow com.apple.security.cs.allow-unsigned-executable-memory?
Oh, you’re a system extension. That changes things.
System extensions, due to their privileges position on the system, are not allow to use entitlements to disable the additional security measures imposed by the hardened runtime. The only exception that that rule is that macOS platform extensions [1] are allowed to use JIT via the com.apple.security.cs.allow-jit entitlement.
Sadly this isn’t documented on the Hardened Runtime page, and I’ve filed a bug to get that fixed (r. 164078299).
So, if you want to use JIT in your sysex, you can’t lean on the com.apple.security.cs.allow-unsigned-executable-memory compatibility crutch. You’ll have to do the right thing and use com.apple.security.cs.allow-jit, as explained in Porting just-in-time compilers to Apple silicon.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] So, not DriverKit drivers.