Skip to content

Commit

Permalink
Set mprotect as read+write on patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-Durov committed Apr 13, 2024
1 parent b334bfa commit 6f4bdc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ykrt/src/trace/swt/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ unsafe fn patch_function(function_ptr: usize, code: *const u8, size: size_t) {
- (func_address as usize)) as usize;

// Set function memory region to be writable
let result = mprotect(func_address, page_size_aligned, PROT_READ | PROT_WRITE | PROT_EXEC);
let result = mprotect(func_address, page_size_aligned, PROT_READ | PROT_WRITE);
if result != 0 {
panic!("Failed to change memory protection to be writable");
}
Expand Down

0 comments on commit 6f4bdc3

Please sign in to comment.