|author||Peter Collingbourne <email@example.com>||Wed Nov 24 22:49:32 2021|
|committer||Crashpad LUCI CQ <firstname.lastname@example.org>||Thu Nov 25 00:33:31 2021|
Reraise signals via rt_tgsigqueueinfo(2) on Linux (try 2). 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 <email@example.com> Commit-Queue: Peter Collingbourne <firstname.lastname@example.org>
Crashpad is a crash-reporting system.
Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.