Skip to content

Commit 5b5e2fc

Browse files
committed
Add initial support for AT_RSEQ_*
In newer operating systems AT_RSEQ_* parameters are automatically added to binaries. This does not mean that the application uses rseq, but it is a possibility. Currently we do not support rseq as it is a complex issue, so for now we allow AT_RSEQ_* to be passed, however a warning is printed, as there are no guarantees rseq will not be used by the binary. In most of the cases however resq is not used and majority of binaries should run without any issues.
1 parent 5748b2a commit 5b5e2fc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

elf/elf_loader.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,18 @@ void elf_run(uintptr_t entry_address, char *filename, int argc, char **argv, cha
377377
d_aux->a_un.a_val = s_aux->a_un.a_val;
378378
break;
379379

380+
#ifdef AT_RSEQ_FEATURE_SIZE
381+
case AT_RSEQ_FEATURE_SIZE:
382+
#endif
383+
#ifdef AT_RSEQ_ALIGN
384+
case AT_RSEQ_ALIGN:
385+
#endif
386+
#if defined(AT_RSEQ_FEATURE_SIZE) || defined(AT_RSEQ_ALIGN)
387+
fprintf(stderr, "MAMBO: AT_RSEQ_* found! Repeatable sequences (rseq) are not currently supported!\n");
388+
d_aux->a_un.a_val = s_aux->a_un.a_val;
389+
break;
390+
#endif
391+
380392
case AT_RANDOM: {
381393
stack_strings -= 15;
382394
memcpy(stack_strings, (void *)s_aux->a_un.a_val, 16);

0 commit comments

Comments
 (0)