mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
Kernel/ProcFS: Allow a process directory to have a null Process pointer
In case we are about to delete the PID directory, we clear the Process pointer. If someone still holds a reference to the PID directory (by opening it), we still need to delete the process, but we can't delete the directory, so we will keep it alive, but any operation on it will fail by propogating the error to userspace about that the Process was deleted and therefore there's no meaning to trying to do operations on the directory. Fixes #8576.
This commit is contained in:
parent
d1028f8aed
commit
bee75c1f24
Notes:
sideshowbarker
2024-07-18 09:03:43 +09:00
Author: https://github.com/supercomputer7
Commit: bee75c1f24
Pull-request: https://github.com/SerenityOS/serenity/pull/8648
Issue: https://github.com/SerenityOS/serenity/issues/8576
4 changed files with 87 additions and 24 deletions
|
@ -59,8 +59,6 @@ void ProcFSComponentRegistry::unregister_process(Process& deleted_process)
|
|||
process_folder->prepare_for_deletion();
|
||||
process_folder->m_list_node.remove();
|
||||
dbgln_if(PROCFS_DEBUG, "ProcFSExposedDirectory ref_count now: {}", process_folder->ref_count());
|
||||
// Note: Let's ensure we are the last holder of the ProcFSProcessDirectory object before it can be deleted for good
|
||||
VERIFY(process_folder->ref_count() == 1);
|
||||
}
|
||||
|
||||
RefPtr<ProcFS> ProcFS::create()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue