Skip to content

Commit

Permalink
Remove more whitelist items for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
riesentoaster committed Dec 19, 2024
1 parent 6a41e10 commit 6c93faa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
8 changes: 0 additions & 8 deletions libafl_frida/src/asan/asan_rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ impl AsanRuntime {
}

/// Register the current thread with the runtime, implementing shadow memory for its stack mapping.
#[expect(clippy::unused_self)]
#[cfg(target_vendor = "apple")]
pub fn register_thread(&mut self) {
let (stack_start, stack_end) = Self::current_stack();
Expand Down Expand Up @@ -1471,7 +1470,6 @@ impl AsanRuntime {
let backtrace = Backtrace::new();

let (stack_start, stack_end) = Self::current_stack();
#[expect(clippy::option_if_let_else)]
let error = if fault_address >= stack_start && fault_address < stack_end {
if insn.opcode.to_string().starts_with('l') {
AsanError::StackOobRead((
Expand Down Expand Up @@ -1709,7 +1707,6 @@ impl AsanRuntime {
}

#[cfg(target_arch = "aarch64")]
#[expect(clippy::unused_self)]
fn generate_shadow_check_blob(&mut self, width: u32) -> Box<[u8]> {
/*x0 contains the shadow address
x0 and x1 are saved by the asan_check
Expand Down Expand Up @@ -1752,7 +1749,6 @@ impl AsanRuntime {
}

#[cfg(target_arch = "aarch64")]
#[expect(clippy::unused_self)]
fn generate_shadow_check_large_blob(&mut self, width: u32) -> Box<[u8]> {
//x0 contains the shadow address
//x0 and x1 are saved by the asan_check
Expand Down Expand Up @@ -1887,9 +1883,7 @@ impl AsanRuntime {
///
/// Generate the instrumentation blobs for the current arch.
#[cfg(target_arch = "aarch64")]
#[expect(clippy::similar_names)] // We allow things like dword and qword
#[expect(clippy::cast_possible_wrap)]
#[expect(clippy::too_many_lines)]
fn generate_instrumentation_blobs(&mut self) {
let mut ops_report = dynasmrt::VecAssembler::<dynasmrt::aarch64::Aarch64Relocation>::new(0);
dynasm!(ops_report
Expand Down Expand Up @@ -2594,7 +2588,6 @@ impl AsanRuntime {
#[expect(clippy::comparison_chain)]
if displacement < 0 {
if displacement > -4096 {
#[expect(clippy::cast_sign_loss)]
let displacement = displacement.unsigned_abs();
// Subtract the displacement into x0
writer.put_sub_reg_reg_imm(
Expand All @@ -2603,7 +2596,6 @@ impl AsanRuntime {
u64::from(displacement),
);
} else {
#[expect(clippy::cast_sign_loss)]
let displacement = displacement.unsigned_abs();
let displacement_hi = displacement / 4096;
let displacement_lo = displacement % 4096;
Expand Down
2 changes: 2 additions & 0 deletions libafl_frida/src/asan/hook_funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ impl AsanRuntime {
}

#[expect(non_snake_case)]
#[expect(clippy::used_underscore_items)]
#[inline]
pub fn hook__Znwm(
&mut self,
Expand Down Expand Up @@ -795,6 +796,7 @@ impl AsanRuntime {
}

#[expect(non_snake_case)]
#[expect(clippy::used_underscore_items)]
#[inline]
pub fn hook__ZnwmSt11align_val_t(
&mut self,
Expand Down
1 change: 1 addition & 0 deletions libafl_frida/src/coverage_rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl FridaRuntime for CoverageRuntime {

impl CoverageRuntime {
/// Create a new coverage runtime
#[allow(clippy::large_stack_arrays)]
#[must_use]
pub fn new() -> Self {
Self(Rc::pin(RefCell::new(CoverageRuntimeInner {
Expand Down

0 comments on commit 6c93faa

Please sign in to comment.