mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-15 10:07:56 +08:00
0d26b02c37
Previously we would rely on implicit re-raising to deliver signals to the underlying handler on POSIX systems if the signal is detected as being re-raisable via WillSignalReraiseAutonomously(). This detection mechanism is imperfect, as it will misclassify signals delivered as a result of kill(2) when passing a signal number usually used for synchronous signals, but now also asynchronous MTE tag check faults, which are delivered as SIGSEGV signals on Linux. As a result, these signals would not be re-raised and therefore would be discarded. Although we could, for example, teach WillSignalReraiseAutonomously() about MTE faults, the signal would still be re-raised via raise(3) and therefore we would lose the information in siginfo. We can avoid discarding these signals on Linux while at the same time preserving the siginfo by making use of the syscall rt_tgsigqueueinfo(2) which delivers a signal together with a user-provided siginfo. The problem still exists on non-Linux POSIX systems because this syscall is Linux-specific. With kernel versions prior to 3.9, the kernel will reject the rt_tgsigqueueinfo() syscall with EPERM. If that happens, follow the non-Linux code path. Change-Id: Ia410fbd651a756945c9402e361edfd5c520453d6 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3300991 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Peter Collingbourne <pcc@chromium.org>