Merge pull request #25399 from DaanDeMeyer/siginfo-crash

crash-handler: Make sure we propagate the original siginfo
This commit is contained in:
Lennart Poettering
2022-11-16 18:42:07 +01:00
committed by GitHub
4 changed files with 26 additions and 5 deletions
+14
View File
@@ -363,6 +363,20 @@ static inline int missing_rt_sigqueueinfo(pid_t tgid, int sig, siginfo_t *info)
/* ======================================================================= */
#if !HAVE_RT_TGSIGQUEUEINFO
static inline int missing_rt_tgsigqueueinfo(pid_t tgid, pid_t tid, int sig, siginfo_t *info) {
# if defined __NR_rt_tgsigqueueinfo && __NR_rt_tgsigqueueinfo >= 0
return syscall(__NR_rt_tgsigqueueinfo, tgid, tid, sig, info);
# else
# error "__NR_rt_tgsigqueueinfo not defined"
# endif
}
# define rt_tgsigqueueinfo missing_rt_tgsigqueueinfo
#endif
/* ======================================================================= */
#if !HAVE_EXECVEAT
static inline int missing_execveat(int dirfd, const char *pathname,
char *const argv[], char *const envp[],
+2 -1
View File
@@ -102,7 +102,8 @@ static void sigbus_handler(int sn, siginfo_t *si, void *data) {
if (si->si_code != BUS_ADRERR || !si->si_addr) {
assert_se(sigaction(SIGBUS, &old_sigaction, NULL) == 0);
rt_sigqueueinfo(getpid_cached(), SIGBUS, si);
if (rt_tgsigqueueinfo(getpid_cached(), gettid(), SIGBUS, si) < 0)
(void) raise(SIGBUS);
return;
}