Skip to content

Commit

Permalink
Fix aarch64 unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
mineo333 committed Apr 23, 2024
1 parent 2e1b4e6 commit 95b7114
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions libafl_frida/src/asan/asan_rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,8 @@ impl AsanRuntime {
The format of Frida's ASAN is signficantly different from LLVM ASAN.
In Frida ASAN, we attempt to find the lowest possible bit such that there is no mapping with that bit. That is to say, for some bit x, there is no mapping greater than
1 << x. This is our shadow base and is similar to Ultra compact shadow in LLVM ASAN. Unlike ASAN where 0 represents a poisoned byte and 1 represents an unpoisoned byte.
1 << x. This is our shadow base and is similar to Ultra compact shadow in LLVM ASAN. Unlike ASAN where 0 represents a poisoned byte and 1 represents an unpoisoned byte, in Frida-ASAN
The reasoning for this is that new pages are zeroed, so, by default, every qword is poisoned and we must explicitly unpoison any byte.
Much like LLVM ASAN, shadow bytes are qword based. This is to say that each shadow byte maps to one qword. The shadow calculation is as follows:
Expand Down Expand Up @@ -2089,7 +2090,7 @@ impl AsanRuntime {
self.blob_check_mem_qword = Some(self.generate_shadow_check_blob(8));
self.blob_check_mem_16bytes = Some(self.generate_shadow_check_blob(16));

self.blob_check_mem_3bytes = Some(self.generate_shadow_check_blob(3));
self.blob_check_mem_3bytes = Some(self.generate_shadow_check_blob(3)); //the below are all possible with vector intrinsics
self.blob_check_mem_6bytes = Some(self.generate_shadow_check_blob(6));
self.blob_check_mem_12bytes = Some(self.generate_shadow_check_blob(12));
self.blob_check_mem_24bytes = Some(self.generate_shadow_check_blob(24));
Expand Down
5 changes: 4 additions & 1 deletion libafl_frida/src/hook_rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ use yaxpeax_arm::armv8::a64::{InstDecoder, Opcode, Operand};
#[cfg(target_arch = "aarch64")]
use frida_gum::instruction_writer::{Aarch64Register,Aarch64InstructionWriter,IndexMode,InstructionWriter};

use std::ptr::{read_unaligned, addr_of};
#[cfg(target_arch = "x86_64")]
use std::ptr::read_unaligned;

use std::ptr::addr_of;

use crate::{
asan::asan_rt::AsanRuntime,
Expand Down

0 comments on commit 95b7114

Please sign in to comment.