Kernel: Update process promise states on execve() and fork()

We now move the execpromises state into the regular promises, and clear
the execpromises state.

Also make sure to duplicate the promise state on fork.

This fixes an issue where "su" would launch a shell which immediately
crashed due to not having pledged "stdio".
This commit is contained in:
Andreas Kling 2021-01-26 15:25:18 +01:00
commit c7858622ec
Notes: sideshowbarker 2024-07-18 22:50:46 +09:00
4 changed files with 10 additions and 1 deletions

View file

@ -84,7 +84,9 @@ int Process::sys$pledge(Userspace<const Syscall::SC_pledge_params*> user_params)
return -EPERM;
}
m_has_promises = true;
m_has_promises = m_has_promises || !promises.is_null();
m_has_execpromises = m_has_execpromises || !execpromises.is_null();
m_promises = new_promises;
m_execpromises = new_execpromises;