Unset DYLD_INSERT_BINARIES when unneeded

Previously, the tracer environment variables were set for the
current process, and for future steps, in the init action. In
certain scenarios (such as on MacOS ARM runners with System
Integrity Protection disabled), these environment variables are
not unset by the system. In particular, the `DYLD_INSERT_BINARIES`
variable interferes with later system calls.

This change unsets the `DYLD_INSERT_BINARIES` variable for the
current process in init. It also unsets the variables either at the
beginning of autobuild, or analyze, if autobuild has not run.
This commit is contained in:
Angela P Wen
2024-08-14 17:28:40 -07:00
parent a93f8c2fd1
commit 954566eac2
16 changed files with 57 additions and 6 deletions
+1
View File
@@ -25,6 +25,7 @@ var EnvVar;
* notifications in the `run[].invocations[].toolExecutionNotifications` SARIF property.
*/
EnvVar["DISABLE_DUPLICATE_LOCATION_FIX"] = "CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX";
EnvVar["DYLD_INSERT_BINARIES"] = "DYLD_INSERT_BINARIES";
/**
* Whether the CodeQL Action is using its own deprecated and non-standard way of scanning for
* multiple languages.