[compiler-rt] scudo: default enabled dealloc_type_mismatch on new platforms (PR #146739)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 2 09:13:07 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Justin King (jcking)
<details>
<summary>Changes</summary>
Default enable on new platforms, leaving it disabled for existing well known platforms using scudo.
---
Full diff: https://github.com/llvm/llvm-project/pull/146739.diff
1 Files Affected:
- (modified) compiler-rt/lib/scudo/standalone/flags.inc (+5-1)
``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/flags.inc b/compiler-rt/lib/scudo/standalone/flags.inc
index ff0c28e1db7c4..570c1defb23ea 100644
--- a/compiler-rt/lib/scudo/standalone/flags.inc
+++ b/compiler-rt/lib/scudo/standalone/flags.inc
@@ -24,7 +24,11 @@ SCUDO_FLAG(int, quarantine_max_chunk_size, 0,
"Size (in bytes) up to which chunks will be quarantined (if lower "
"than or equal to).")
-SCUDO_FLAG(bool, dealloc_type_mismatch, false,
+// Historically dealloc_type_mismatch was disabled by default. Mismatching is
+// undefined behavior and software that triggers it should feel bad. To stop the
+// bleeding, we default enable except on Android, Fuchsia, and Trusty.
+SCUDO_FLAG(bool, dealloc_type_mismatch,
+ !SCUDO_ANDROID && !SCUDO_FUCHSIA && !SCUDO_TRUSTY,
"Terminate on a type mismatch in allocation-deallocation functions, "
"eg: malloc/delete, new/free, new/delete[], etc.")
``````````
</details>
https://github.com/llvm/llvm-project/pull/146739
More information about the llvm-commits
mailing list