32-on-64 (x86-64) siginfo corruption
The situation: 32-bit debugger, 32-bit child, 64-bit kernel
The debugger sends an RT signal to the child. (to stop it, with a queue and siginfo so that non-debugger signals don't get lost) To do this, the debugger uses tgkill().
Later, the debugger checks the child's siginfo_t before discarding it. This is to be sure that the child didn't get the RT signal from some other source. The debugger fills a siginfo_t with 0xff, then fetches siginfo data via ptrace. The data is corrupt:
FIELD 32-ON-64 NORMAL si_pid -1 getpid() si_uid getpid() getuid()
The "getpid" and "getuid" above are done in the debugger, not in the child. The si_code values are SI_TKILL.
Probably the other ports with 32-on-64 support ought to verify that this stuff works right.
From: "Albert Cahalan" <[email protected]>
Date: Wed, 5 Apr 2006 23:20:07 -0400
Quoted 15 lines
The situation: 32-bit debugger, 32-bit child, 64-bit kernel
The debugger sends an RT signal to the child. (to stop it, with a queue and siginfo so that non-debugger signals don't get lost) To do this, the debugger uses
tgkill().Later, the debugger checks the child's
siginfo_tbefore discarding it. This is to be sure that the child didn't get the RT signal from some other source. The debugger fills asiginfo_twith0xff, then fetches siginfo data via ptrace. The data is corrupt:FIELD 32-ON-64 NORMAL si_pid -1 getpid() si_uid getpid() getuid()
Quoted 5 lines
The "getpid" and "getuid" above are done in the debugger, not in the child. The
si_codevalues areSI_TKILL.Probably the other ports with 32-on-64 support ought to verify that this stuff works right.
Ugh, just like PTRACE_GETEVENTMSG we'll need translations for GETSIGINFO and SETSIGINFO.
I've CC'd linux-arch which is where the port maintainers hang out and look for postings about issues like this. I mentioned the PTRACE_GETEVENTMSG issue there just the other day.