Skip to content

Commit

Permalink
Add initial support for AT_RSEQ_*
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
IgWod committed May 21, 2024
1 parent 5748b2a commit d3d0b98
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions elf/elf_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,12 @@ void elf_run(uintptr_t entry_address, char *filename, int argc, char **argv, cha
d_aux->a_un.a_val = s_aux->a_un.a_val;
break;

case AT_RSEQ_FEATURE_SIZE:
case AT_RSEQ_ALIGN:
fprintf(stderr, "MAMBO: AT_RSEQ_* found! Repeatable sequences (rseq) are not currently supported!\n");
d_aux->a_un.a_val = s_aux->a_un.a_val;
break;

case AT_RANDOM: {
stack_strings -= 15;
memcpy(stack_strings, (void *)s_aux->a_un.a_val, 16);
Expand Down

0 comments on commit d3d0b98

Please sign in to comment.