mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-24 03:59:09 +00:00
Kernel/VFS: Check matching absolute path when jump to mount guest inode
We could easily encounter a case where we do the following: ``` mkdir -p /tmp2 mount /dev/hda /tmp2 ``` would produce a bug that doing `ls /tmp2/tmp2` will give the contents on `/dev/hda` ext2 root directory and also on `/tmp2/tmp2/tmp2` and so on. To prevent this, we must compare the current custody against each mount entry's custody to ensure their paths match.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
80f400a150
commit
e5c7662638
@@ -119,7 +119,7 @@ private:
|
||||
bool mount_point_exists_at_custody(Custody& mount_point);
|
||||
|
||||
// FIXME: These functions are totally unsafe as someone could unmount the returned Mount underneath us.
|
||||
Mount* find_mount_for_host(InodeIdentifier);
|
||||
Mount* find_mount_for_host_custody(Custody const& current_custody);
|
||||
Mount* find_mount_for_guest(InodeIdentifier);
|
||||
|
||||
RefPtr<Inode> m_root_inode;
|
||||
|
||||
Reference in New Issue
Block a user