path: root/lib/msan
diff options
authorEvgeniy Stepanov <>2017-09-05 21:08:56 +0000
committerEvgeniy Stepanov <>2017-09-05 21:08:56 +0000
commitad3d7d644c42e6ec6ae448800574d837d10dde86 (patch)
tree68fff739993255bd6f8203ba52a6852330f5eac4 /lib/msan
parent547f9dadc814bbf52420f4edac6ccd56b4e950b3 (diff)
[msan] Check sigset_t and sigaction arguments.
Summary: Check sigset_t arguments in ppoll, sig*wait*, sigprocmask interceptors, and the entire "struct sigaction" in sigaction. This can be done because sigemptyset/sigfullset are intercepted and signal masks should be correctly marked as initialized. Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan')
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/msan/ b/lib/msan/
index 08eb261aa..916e25557 100644
--- a/lib/msan/
+++ b/lib/msan/
@@ -983,11 +983,21 @@ static void SignalAction(int signo, void *si, void *uc) {
cb(signo, si, uc);
+static void read_sigaction(const __sanitizer_sigaction *act) {
+ CHECK_UNPOISONED(&act->sa_flags, sizeof(act->sa_flags));
+ if (act->sa_flags & __sanitizer::sa_siginfo)
+ CHECK_UNPOISONED(&act->sigaction, sizeof(act->sigaction));
+ else
+ CHECK_UNPOISONED(&act->handler, sizeof(act->handler));
+ CHECK_UNPOISONED(&act->sa_mask, sizeof(act->sa_mask));
INTERCEPTOR(int, sigaction, int signo, const __sanitizer_sigaction *act,
__sanitizer_sigaction *oldact) {
// FIXME: check that *act is unpoisoned.
// That requires intercepting all of sigemptyset, sigfillset, etc.
+ if (act) read_sigaction(act);
int res;
if (flags()->wrap_signals) {
SpinMutexLock lock(&sigactions_mu);