Kernel: Change unveil state to dropped even when node already exists

This also changes the UnveilState to Dropped when the path unveil() is
called for already has a node.

This fixes a bug where unveiling "/" would previously keep the
UnveilState as None, which meant that everything was still accessible
until unveil() was called with any non-root path (or nullptr).
This commit is contained in:
Max Wipfli 2021-06-06 23:10:27 +02:00 committed by Andreas Kling
parent 2fcebfd6a8
commit 8930db0900
Notes: sideshowbarker 2024-07-18 12:38:07 +09:00

View file

@ -116,6 +116,7 @@ KResultOr<int> Process::sys$unveil(Userspace<const Syscall::SC_unveil_params*> u
update_intermediate_node_permissions(matching_node, (UnveilAccess)new_permissions);
matching_node.set_metadata({ matching_node.path(), (UnveilAccess)new_permissions, true });
m_veil_state = VeilState::Dropped;
return 0;
}