DynamoRIO / DynamoRIO/dynamorio
DynamoRIO emulation of signal delivery does not create a frame record
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 30
Description
This is AArch64-specific as described, but there might be a similar problem on other architectures.
When a recent Linux kernel delivers a signal it includes a frame record in the new stack frame and updates X29. DynamoRIO's emulation does not do this. This is a very minor deviation from full transparency and I do not know of a real application that might notice, but it would not be hard to fix. It might be worth comparing hex dumps of the signal stack frame to see if there are any other minor deviations that could be fixed.
Of course there is the problem that different kernel versions may deliver signals in slightly different ways.
```
$ gcc -Wall -O2 sigfr.c sigfr1.s
$ ./a.out
0x7fecded5e0 0x7fecded5f0 0x400614
0x7fecded5f0 0x7fecded6a0 0x7faa7fe810
0x7fecded6a0 (nil) 0x400640
Done
$ bin64/drrun -- ./a.out
0x7fc9dc6aa0 0x7fc9dc6b50 0x7fb6b6c810
0x7fc9dc6b50 (nil) 0x400640
Done
```
```
// sigfr.c
#include
#include
#include
#include
#include
void handler(int);
int main()
{
struct sigaction act;
memset(&act, 0, sizeof(act));
act.sa_handler = handler;
sigaction(SIGALRM, &act, 0);
alarm(1);
for (;;)
;
return 1;
}
void finish(void **fp)
{
/* Print frame records. */
while (fp != NULL) {
printf("%16p %16p %16p\n", fp, fp[0], fp[1]);
fp = fp[0];
}
printf("Done\n");
exit(0);
}
```
```
// sigfr1.s
.global handler
handler:
mov x0, x29
b finish
```
Contributor guide
Assessment
This issue has not been assessed yet.