mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +00:00
Kernel: Put Process unveil state in a SpinlockProtected container
This makes path resolution safe to perform without holding the big lock.
This commit is contained in:
parent
24f02bd421
commit
580d89f093
Notes:
sideshowbarker
2024-07-17 17:49:23 +09:00
Author: https://github.com/awesomekling
Commit: 580d89f093
7 changed files with 87 additions and 67 deletions
|
@ -748,10 +748,10 @@ UnveilNode const& VirtualFileSystem::find_matching_unveiled_path(StringView path
|
|||
{
|
||||
auto& current_process = Process::current();
|
||||
VERIFY(current_process.veil_state() != VeilState::None);
|
||||
auto& unveil_root = current_process.unveiled_paths();
|
||||
|
||||
auto path_parts = KLexicalPath::parts(path);
|
||||
return unveil_root.traverse_until_last_accessible_node(path_parts.begin(), path_parts.end());
|
||||
return current_process.unveil_data().with([&](auto const& unveil_data) -> UnveilNode const& {
|
||||
auto path_parts = KLexicalPath::parts(path);
|
||||
return unveil_data.paths.traverse_until_last_accessible_node(path_parts.begin(), path_parts.end());
|
||||
});
|
||||
}
|
||||
|
||||
ErrorOr<void> VirtualFileSystem::validate_path_against_process_veil(Custody const& custody, int options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue