From 5d668a43b3fd25a12b87602167544df2c84de791 Mon Sep 17 00:00:00 2001 From: edef Date: Thu, 3 Feb 2022 04:15:20 +0000 Subject: ripple/minitrace: only disable ASLR in tracee Change-Id: I6df0596ecc0ba9514c04339dbd80469880e30f4c --- ripple/minitrace/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ripple/minitrace') diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs index 1e8f583..3f846b6 100644 --- a/ripple/minitrace/src/main.rs +++ b/ripple/minitrace/src/main.rs @@ -45,6 +45,11 @@ impl Process { fn spawn(cmd: &mut Command) -> anyhow::Result { unsafe { cmd.pre_exec(|| { + // disable ASLR + let mut persona = personality::get()?; + persona.insert(Persona::ADDR_NO_RANDOMIZE); + personality::set(persona)?; + ptrace::traceme()?; Ok(()) }); @@ -89,11 +94,6 @@ enum EntryExit { } fn main() -> anyhow::Result<()> { - // disable ASLR - let mut persona = personality::get()?; - persona.insert(Persona::ADDR_NO_RANDOMIZE); - personality::set(persona)?; - let process = Process::spawn(&mut { let mut args = env::args(); -- cgit 1.4.1