Skip to content

Commit

Permalink
Mark rcx and r11 as clobbered in the relro mprotect. (#78)
Browse files Browse the repository at this point in the history
On x86-64, rcx and r11 are clobbered by syscalls, so mark them as
clobbered in the relro mprotect too.
  • Loading branch information
sunfishcode committed Oct 10, 2023
1 parent a37c373 commit c0602b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/arch/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ pub(super) unsafe fn relocation_mprotect_readonly(ptr: usize, len: usize) {
in("rdi") ptr,
in("rsi") len,
in("rdx") PROT_READ,
lateout("rcx") _,
lateout("r11") _,
options(nostack, preserves_flags),
);

Expand Down

0 comments on commit c0602b5

Please sign in to comment.