[compiler-rt] [MSan] Fix wrong unpoison size in SignalAction (PR #144071)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 13 05:57:52 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Kunqiu Chen (Camsyn)

<details>
<summary>Changes</summary>

MSan should unpoison the parameters of extended signal handlers. 
However, MSan unpoisoned the second parameter with the wrong size 
`sizeof(__sanitizer_sigaction)`, inconsistent with its real type 
`siginfo_t`.

This commit fixes this issue by correcting the size to 
`sizeof(__sanitizer_siginfo)`.

---
Full diff: https://github.com/llvm/llvm-project/pull/144071.diff


1 Files Affected:

- (modified) compiler-rt/lib/msan/msan_interceptors.cpp (+1-1) 


``````````diff
diff --git a/compiler-rt/lib/msan/msan_interceptors.cpp b/compiler-rt/lib/msan/msan_interceptors.cpp
index 76255cdb742a3..f94d3cb79aa00 100644
--- a/compiler-rt/lib/msan/msan_interceptors.cpp
+++ b/compiler-rt/lib/msan/msan_interceptors.cpp
@@ -1127,7 +1127,7 @@ static void SignalAction(int signo, void *si, void *uc) {
   SignalHandlerScope signal_handler_scope;
   ScopedThreadLocalStateBackup stlsb;
   UnpoisonParam(3);
-  __msan_unpoison(si, sizeof(__sanitizer_sigaction));
+  __msan_unpoison(si, sizeof(__sanitizer_siginfo));
   __msan_unpoison(uc, ucontext_t_sz(uc));
 
   typedef void (*sigaction_cb)(int, void *, void *);

``````````

</details>


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


More information about the llvm-commits mailing list