[compiler-rt] [sanitizer] Disable writes to log files for binaries in a secure context. (PR #92593)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 13:31:32 PDT 2024


================
@@ -518,6 +522,15 @@ bool IsStateDetached(int state) {
   return state == PTHREAD_CREATE_DETACHED;
 }
 
+bool ShouldTreatRuntimeSecurely() {
+#  if SANITIZER_LINUX
+  // So we can use weak reference from sanitizer_getauxval.h
+  if (&getauxval)
+    return getauxval(/* AT_SECURE */ 23) != 0;
+#  endif
+  return getuid() != geteuid() || getgid() != getegid();
----------------
vitalybuka wrote:

why not just return false?

https://github.com/llvm/llvm-project/pull/92593


More information about the llvm-commits mailing list