diff options
author | edef <edef@unfathomable.blue> | 2022-02-03 04:15:20 +0000 |
---|---|---|
committer | edef <edef@unfathomable.blue> | 2022-02-03 04:15:20 +0000 |
commit | 5d668a43b3fd25a12b87602167544df2c84de791 (patch) | |
tree | 815a663fa16c9b4c9c97fe22edaa75d15a7f15da /ripple | |
parent | 4a22a828245955fb3edeac5c3d3a297aa165e1fa (diff) | |
download | unf-legacy-5d668a43b3fd25a12b87602167544df2c84de791.tar.zst |
ripple/minitrace: only disable ASLR in tracee
Change-Id: I6df0596ecc0ba9514c04339dbd80469880e30f4c
Diffstat (limited to 'ripple')
-rw-r--r-- | ripple/minitrace/src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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<Process> { 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(); |