Browse Source

Kernel: Log when a process exits with an unlocked veil

This catches applications that make use of `unveil()`, but then do not
lock the veil with `unveil(nullptr, nullptr)`.
Sam Atkins 3 năm trước cách đây
mục cha
commit
6dd2ebfe8e
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      Kernel/Process.cpp

+ 3 - 0
Kernel/Process.cpp

@@ -608,6 +608,9 @@ void Process::finalize()
 
     dbgln_if(PROCESS_DEBUG, "Finalizing process {}", *this);
 
+    if (veil_state() == VeilState::Dropped)
+        dbgln("\x1b[01;31mProcess '{}' exited with the veil left open\x1b[0m", name());
+
     if (is_dumpable()) {
         if (m_should_generate_coredump)
             dump_core();