diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2022-02-13 17:31:33 +0100 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2022-02-13 21:58:26 +0200 |
commit | b0df0962988a2b972143a20c69f52cd54c1d196b (patch) | |
tree | d4aecb98b589b792f9968aa2094c7d55f8100d13 /Kernel/FileSystem/VirtualFileSystem.cpp | |
parent | f3cf1b33d7a1c7f774c4c48ebc7f098c829cb99b (diff) | |
download | serenity-b0df0962988a2b972143a20c69f52cd54c1d196b.zip |
Kernel/VFS: Add FIXMEs about error codes leaking data from veiled paths
Error codes can leak information about veiled paths, if the path
resolution fails with e.g. EACCESS.
This is non-trivial to fix, as there is a group of error codes we want
to propagate to the caller, such as ENOMEM.
Diffstat (limited to 'Kernel/FileSystem/VirtualFileSystem.cpp')
-rw-r--r-- | Kernel/FileSystem/VirtualFileSystem.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index 5c0426cd51..ca63fdd7da 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -363,6 +363,8 @@ ErrorOr<void> VirtualFileSystem::mkdir(StringView path, mode_t mode, Custody& ba } RefPtr<Custody> parent_custody; + // FIXME: The errors returned by resolve_path_without_veil can leak information about paths that are not unveiled, + // e.g. when the error is EACCESS or similar. auto result = resolve_path_without_veil(path, base, &parent_custody); if (!result.is_error()) return EEXIST; @@ -828,6 +830,8 @@ ErrorOr<void> VirtualFileSystem::validate_path_against_process_veil(StringView p ErrorOr<NonnullRefPtr<Custody>> VirtualFileSystem::resolve_path(StringView path, Custody& base, RefPtr<Custody>* out_parent, int options, int symlink_recursion_level) { + // FIXME: The errors returned by resolve_path_without_veil can leak information about paths that are not unveiled, + // e.g. when the error is EACCESS or similar. auto custody = TRY(resolve_path_without_veil(path, base, out_parent, options, symlink_recursion_level)); if (auto result = validate_path_against_process_veil(*custody, options); result.is_error()) { if (out_parent) |