Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Signature Invalid crash using com.apple.security.cs.allow-jit #145

Open
low-batt opened this issue Dec 23, 2021 · 0 comments
Open

Code Signature Invalid crash using com.apple.security.cs.allow-jit #145

low-batt opened this issue Dec 23, 2021 · 0 comments

Comments

@low-batt
Copy link

In this Apple forum thread: App not launching after signing with hardened runtime, Apple developer relations says:

If your app uses a JIT, you should only need

com.apple.security.cs.allow-jit

If that’s insufficient, you need to dig into the code to find out why.

IINA is using the OpenResty LuaJIT library and using that entitlement resulted in "Code Signature Invalid" crashes as reported in IINA issue iina/iina#3551

The problem appears to be that LuaJIT is not following the best practices specified in this Apple document: Porting Just-In-Time Compilers to Apple Silicon

Another developer pointed out that LuaJIT is not using the MAP_JIT flag, one of the requirements specified in the above document:

low-batt@gag luajit2 (v2.1-agentzh $=)$ grep -inr 'MAP_JIT' *
low-batt@gag luajit2 (v2.1-agentzh $=)$ 

That means instead of the Allow Execution of JIT-compiled Code Entitlement, IINA must use the Allow Unsigned Executable Memory Entitlement, for which Apple warns:

Including this entitlement exposes your app to common vulnerabilities in memory-unsafe code languages. Carefully consider whether your app needs this exception.

Therefore for security reasons it is desirable that LuaJIT be updated to follow Apple's best practices for JIT compilers and support use of the more restrictive Allow Execution of JIT-compiled Code Entitlement.

low-batt added a commit to low-batt/iina that referenced this issue Dec 23, 2021
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
low-batt added a commit to CarterLi/iina that referenced this issue Dec 23, 2021
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
CarterLi pushed a commit to CarterLi/iina that referenced this issue Jan 19, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
CarterLi pushed a commit to CarterLi/iina that referenced this issue Jan 21, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
low-batt added a commit to CarterLi/iina that referenced this issue Jan 21, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
CarterLi pushed a commit to CarterLi/iina that referenced this issue Feb 18, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
CarterLi pushed a commit to CarterLi/iina that referenced this issue Feb 21, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
CarterLi pushed a commit to CarterLi/iina that referenced this issue Feb 28, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
CarterLi pushed a commit to CarterLi/iina that referenced this issue Apr 23, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
low-batt added a commit to CarterLi/iina that referenced this issue Apr 23, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
low-batt added a commit to CarterLi/iina that referenced this issue Apr 24, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
low-batt added a commit to CarterLi/iina that referenced this issue Apr 27, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
CarterLi pushed a commit to CarterLi/iina that referenced this issue Apr 28, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
lhc70000 pushed a commit to iina/iina that referenced this issue Apr 30, 2022
This commit will replace the entitlement "com.apple.security.cs.allow-jit" with
"com.apple.security.cs.allow-unsigned-executable-memory" in the
IINA.entitlements file.

This is required because the OpenResty LuaJIT library is not following Apple's
best practices for JIT compilers that allow use of the more restrictive
entitlement. This has been reported in this LuaJIT issue:

Code Signature Invalid crash using com.apple.security.cs.allow-jit
openresty/luajit2#145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant