1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

Kernel: Properly reset m_unveiled_paths on execve()

When a process executes another program, its unveil state is reset. For
this, we not only need to clear all nodes from m_unveiled_paths, but
also reset the metadata of m_unveiled_paths (the root node) itself.

This fixes the following bug:
1) A process unveils "/", then executes another program.
2) That other program also unveils some path.
3) "/" is now unveiled for the new program.
This commit is contained in:
Max Wipfli 2021-06-06 23:23:00 +02:00 committed by Andreas Kling
parent c1de46aaaf
commit 573664758a

View file

@ -553,6 +553,7 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
m_veil_state = VeilState::None;
m_unveiled_paths.clear();
m_unveiled_paths.set_metadata({ "/", UnveilAccess::None, false });
m_coredump_metadata.clear();