[compiler-rt] c361ab0 - [msan] Don't block SIGSYS in ScopedBlockSignals

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 3 11:41:31 PST 2021


Author: Hans Wennborg
Date: 2021-12-03T20:41:08+01:00
New Revision: c361ab061253eedfc7ed905cdbc055de09239543

URL: https://github.com/llvm/llvm-project/commit/c361ab061253eedfc7ed905cdbc055de09239543
DIFF: https://github.com/llvm/llvm-project/commit/c361ab061253eedfc7ed905cdbc055de09239543.diff

LOG: [msan] Don't block SIGSYS in ScopedBlockSignals

Seccomp-BPF-sandboxed processes rely on being able to process SIGSYS
signals.

Differential revision: https://reviews.llvm.org/D115057

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index 2d787332a445a..a92ea01ccccc4 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -162,6 +162,12 @@ ScopedBlockSignals::ScopedBlockSignals(__sanitizer_sigset_t *copy) {
   // on any thread, setuid call hangs.
   // See test/sanitizer_common/TestCases/Linux/setuid.c.
   internal_sigdelset(&set, 33);
+#  endif
+#  if SANITIZER_LINUX
+  // Seccomp-BPF-sandboxed processes rely on SIGSYS to handle trapped syscalls.
+  // If this signal is blocked, such calls cannot be handled and the process may
+  // hang.
+  internal_sigdelset(&set, 31);
 #  endif
   SetSigProcMask(&set, &saved_);
   if (copy)


        


More information about the llvm-commits mailing list