Explorar o código

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).
Max Wipfli %!s(int64=4) %!d(string=hai) anos
pai
achega
8930db0900
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      Kernel/Syscalls/unveil.cpp

+ 1 - 0
Kernel/Syscalls/unveil.cpp

@@ -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;
     }