From 8930db0900ec90f927df7e21d8337a69f809105c Mon Sep 17 00:00:00 2001 From: Max Wipfli Date: Sun, 6 Jun 2021 23:10:27 +0200 Subject: [PATCH] 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). --- Kernel/Syscalls/unveil.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/Syscalls/unveil.cpp b/Kernel/Syscalls/unveil.cpp index 77dca0fa74..b76bb9aa62 100644 --- a/Kernel/Syscalls/unveil.cpp +++ b/Kernel/Syscalls/unveil.cpp @@ -116,6 +116,7 @@ KResultOr Process::sys$unveil(Userspace 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; }