mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-09 16:42:19 +02:00
Kernel/VFS: Ensure working with mount entry per a custody is safe
Previously we could get a raw pointer to a Mount object which might be invalid when actually dereferencing it. To ensure this could not happen, we should just use a callback that will be used immediately after finding the appropriate Mount entry, while holding the mount table lock.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
d216f780a4
commit
5efb91ec06
Notes:
sideshowbarker
2024-07-16 23:38:54 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/5efb91ec06 Pull-request: https://github.com/SerenityOS/serenity/pull/20358 Reviewed-by: https://github.com/gmta ✅
@@ -114,8 +114,7 @@ private:
|
||||
static bool check_matching_absolute_path_hierarchy(Custody const& first_custody, Custody const& second_custody);
|
||||
bool mount_point_exists_at_custody(Custody& mount_point);
|
||||
|
||||
// FIXME: This function is totally unsafe as someone could unmount the returned Mount underneath us.
|
||||
Mount* find_mount_for_host_custody(Custody const& current_custody);
|
||||
ErrorOr<void> apply_to_mount_for_host_custody(Custody const& current_custody, Function<void(Mount&)>);
|
||||
|
||||
RefPtr<Inode> m_root_inode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user