mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
Kernel: Move process signal trampoline address into protected data
This commit is contained in:
parent
08e0e2eb41
commit
b7b7a48c66
3 changed files with 4 additions and 3 deletions
|
@ -118,6 +118,7 @@ protected:
|
||||||
bool m_has_execpromises { false };
|
bool m_has_execpromises { false };
|
||||||
u32 m_execpromises { 0 };
|
u32 m_execpromises { 0 };
|
||||||
mode_t m_umask { 022 };
|
mode_t m_umask { 022 };
|
||||||
|
VirtualAddress m_signal_trampoline;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProcessBase : public ProtectedProcessBase {
|
class ProcessBase : public ProtectedProcessBase {
|
||||||
|
@ -544,7 +545,6 @@ private:
|
||||||
String m_name;
|
String m_name;
|
||||||
|
|
||||||
OwnPtr<Space> m_space;
|
OwnPtr<Space> m_space;
|
||||||
VirtualAddress m_signal_trampoline;
|
|
||||||
|
|
||||||
RefPtr<ProcessGroup> m_pg;
|
RefPtr<ProcessGroup> m_pg;
|
||||||
|
|
||||||
|
|
|
@ -530,7 +530,6 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
|
||||||
}
|
}
|
||||||
|
|
||||||
signal_trampoline_region.value()->set_syscall_region(true);
|
signal_trampoline_region.value()->set_syscall_region(true);
|
||||||
m_signal_trampoline = signal_trampoline_region.value()->vaddr();
|
|
||||||
|
|
||||||
m_executable = main_program_description->custody();
|
m_executable = main_program_description->custody();
|
||||||
m_arguments = arguments;
|
m_arguments = arguments;
|
||||||
|
@ -605,6 +604,8 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
|
||||||
m_execpromises = 0;
|
m_execpromises = 0;
|
||||||
m_has_execpromises = false;
|
m_has_execpromises = false;
|
||||||
|
|
||||||
|
m_signal_trampoline = signal_trampoline_region.value()->vaddr();
|
||||||
|
|
||||||
// FIXME: PID/TID ISSUE
|
// FIXME: PID/TID ISSUE
|
||||||
m_pid = new_main_thread->tid().value();
|
m_pid = new_main_thread->tid().value();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,6 @@ KResultOr<pid_t> Process::sys$fork(RegisterState& regs)
|
||||||
child->m_veil_state = m_veil_state;
|
child->m_veil_state = m_veil_state;
|
||||||
child->m_unveiled_paths = m_unveiled_paths.deep_copy();
|
child->m_unveiled_paths = m_unveiled_paths.deep_copy();
|
||||||
child->m_fds = m_fds;
|
child->m_fds = m_fds;
|
||||||
child->m_signal_trampoline = m_signal_trampoline;
|
|
||||||
child->m_pg = m_pg;
|
child->m_pg = m_pg;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -56,6 +55,7 @@ KResultOr<pid_t> Process::sys$fork(RegisterState& regs)
|
||||||
child->m_sid = m_sid;
|
child->m_sid = m_sid;
|
||||||
child->m_extra_gids = m_extra_gids;
|
child->m_extra_gids = m_extra_gids;
|
||||||
child->m_umask = m_umask;
|
child->m_umask = m_umask;
|
||||||
|
child->m_signal_trampoline = m_signal_trampoline;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbgln_if(FORK_DEBUG, "fork: child={}", child);
|
dbgln_if(FORK_DEBUG, "fork: child={}", child);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue