-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[sanitizer] Disallow external_symbolizer_path with AT_SECURE #92611
[sanitizer] Disallow external_symbolizer_path with AT_SECURE #92611
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Florian Mayer (fmayer) ChangesFull diff: https://github.com/llvm/llvm-project/pull/92611.diff 1 Files Affected:
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
index 0ddc24802d216..68d51dd1cb9b7 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
@@ -25,6 +25,7 @@
# include "sanitizer_common.h"
# include "sanitizer_file.h"
# include "sanitizer_flags.h"
+# include "sanitizer_getauxval.h"
# include "sanitizer_internal_defs.h"
# include "sanitizer_linux.h"
# include "sanitizer_placement_new.h"
@@ -408,7 +409,13 @@ const char *Symbolizer::PlatformDemangle(const char *name) {
static SymbolizerTool *ChooseExternalSymbolizer(LowLevelAllocator *allocator) {
const char *path = common_flags()->external_symbolizer_path;
-
+ // This is so we can use the weak definition from sanitizer_getauxval.h
+ if (&getauxval && getauxval(/* AT_SECURE */ 23) != 0) {
+ Report(
+ "ERROR: external_symbolizer_path cannot be used for AT_SECURE "
+ "(e.g. setuid binaries).\n");
+ Die();
+ }
if (path && internal_strchr(path, '%')) {
char *new_path = (char *)InternalAlloc(kMaxPathLength);
SubstituteForFlagValue(path, new_path, kMaxPathLength);
|
@bigb4ng FYI |
If ran on a system that has
This is about external_symbolizer_path :)
Wait, this addresses a different option than #92593. Please re-open your CL. |
Seems like we don't want to implement this after all. |
Follow-up to #92593. Also makes #92611, google/sanitizers#1130 obsolete.
See google/sanitizers#1130.