msan: check that ucontext_t is initialized on signal return
authorDmitry Vyukov <dvyukov@google.com>
Thu, 23 Dec 2021 08:10:54 +0000 (09:10 +0100)
committerDmitry Vyukov <dvyukov@google.com>
Wed, 5 Jan 2022 12:20:50 +0000 (13:20 +0100)
commit395f737c338c39b892d3ccdd8366dea4fc51c305
tree5ef30606b2867e0eb56958b28c9751101c403282
parent1298273e8206a8fc28369c1ac8dc71a0c9b3851e
msan: check that ucontext_t is initialized on signal return

A signal handler can alter ucontext_t to affect execution after
the signal returns. Check that the contents are initialized.
Restoring unitialized values in registers can't be good.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D116209
compiler-rt/lib/msan/msan_interceptors.cpp
compiler-rt/test/msan/Linux/signal_mcontext2.cpp [new file with mode: 0644]