From c7b84541dc4a04cb1cbc52c517eb74ea371de5a0 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Thu, 21 Jul 2022 11:14:14 +0200 Subject: [PATCH] Improve general flags for userspace_fexec. First, auxiliary vectors are no longer left here in syscall, but remain in relibc. The rationale behind removing them was that they are no longer used by the kernel in any way, as exec is moved to userspace. Second, a ptrace event for address space switches was added. This is to allow tracers to reopen their mem file when that mem file points to different memory (otherwise mem can be decoupled from address spaces and simply use the one that the context uses at the time). --- src/flag.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/flag.rs b/src/flag.rs index d1eb105..b200079 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -201,8 +201,10 @@ bitflags! { /// If you don't catch this, the child is started as normal. const PTRACE_EVENT_CLONE = 0x0000_0000_0000_0100; - const PTRACE_EVENT_MASK = 0x0000_0000_0000_0F00; + /// Sent when current-addrspace is changed, allowing the tracer to reopen the memory file. + const PTRACE_EVENT_ADDRSPACE_SWITCH = 0x0000_0000_0000_0200; + const PTRACE_EVENT_MASK = 0x0000_0000_0000_0F00; /// Special meaning, depending on the event. Usually, when fired before /// an action, it will skip performing that action. @@ -280,13 +282,6 @@ bitflags! { } } -// Auxiliery vector types -pub const AT_NULL: usize = 0; -pub const AT_PHDR: usize = 3; -pub const AT_PHENT: usize = 4; -pub const AT_PHNUM: usize = 5; -pub const AT_ENTRY: usize = 9; - bitflags! { pub struct WaitFlags: usize { const WNOHANG = 0x01;