[compiler-rt] [sanitizer] Disable writes to log files for binaries in a secure context. (PR #92593)
Florian Mayer via llvm-commits
llvm-commits at lists.llvm.org
Fri May 17 13:43:00 PDT 2024
================
@@ -104,6 +111,18 @@ void ReportFile::SetReportPath(const char *path) {
}
}
+#ifdef HAS_GETAUXVAL
+ if (getauxval(AT_SECURE) != 0 && path &&
+ internal_strcmp(path, "stderr") != 0 &&
+ internal_strcmp(path, "stdout") != 0) {
+ Report(
+ "ERROR: log_path must be 'stderr' or 'stdin' for AT_SECURE "
+ "(e.g. setuid binaries), is '%s\n",
----------------
fmayer wrote:
nit: missing ' after %s
https://github.com/llvm/llvm-project/pull/92593
More information about the llvm-commits
mailing list