From: Vinson Lee <vlee@xxxxxxxxxxx> trinity regularly hits the following kernel warning, which doesn't appear to be an actual kernel bug, and stops running. WARNING: at kernel/signal.c:2955 do_rt_tgsigqueueinfo+0x42/0x5c() Call Trace: [<ffffffff8104920c>] warn_slowpath_common+0x85/0x9d [<ffffffff8104923e>] warn_slowpath_null+0x1a/0x1c [<ffffffff810591eb>] do_rt_tgsigqueueinfo+0x42/0x5c [<ffffffff81059257>] sys_rt_tgsigqueueinfo+0x52/0x5f [<ffffffff814df4a9>] system_call_fastpath+0x16/0x1b This patch sanitizes rt_tgsigqueueinfo arguments to avoid triggering the above warning. Signed-off-by: Vinson Lee <vlee@xxxxxxxxxxx> --- syscalls/rt_tgsigqueueinfo.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/syscalls/rt_tgsigqueueinfo.c b/syscalls/rt_tgsigqueueinfo.c index e48515e..5167f74 100644 --- a/syscalls/rt_tgsigqueueinfo.c +++ b/syscalls/rt_tgsigqueueinfo.c @@ -2,7 +2,24 @@ * SYSCALL_DEFINE4(rt_tgsigqueueinfo, pid_t, tgid, pid_t, pid, int, sig, siginfo_t __user *, uinfo) */ +#include <stdlib.h> +#include <signal.h> + #include "sanitise.h" +#include "shm.h" + +static void sanitise_rt_tgsigqueueinfo(int childno) +{ + pid_t tgid = shm->a1[childno]; + pid_t pid = shm->a2[childno]; + siginfo_t * uinfo = (siginfo_t *)shm->a4[childno]; + + if (pid > 0 && tgid > 0 && uinfo->si_code == SI_TKILL) { + do { + uinfo->si_code = rand(); + } while (uinfo->si_code == SI_TKILL); + } +} struct syscall syscall_rt_tgsigqueueinfo = { .name = "rt_tgsigqueueinfo", @@ -13,4 +30,5 @@ struct syscall syscall_rt_tgsigqueueinfo = { .arg3name = "sig", .arg4name = "uinfo", .arg4type = ARG_ADDRESS, + .sanitise = sanitise_rt_tgsigqueueinfo, }; -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe trinity" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html