diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index c2a3f4d565..5c0426cd51 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -363,7 +363,7 @@ ErrorOr VirtualFileSystem::mkdir(StringView path, mode_t mode, Custody& ba } RefPtr parent_custody; - auto result = resolve_path(path, base, &parent_custody); + auto result = resolve_path_without_veil(path, base, &parent_custody); if (!result.is_error()) return EEXIST; else if (!parent_custody) @@ -371,6 +371,7 @@ ErrorOr VirtualFileSystem::mkdir(StringView path, mode_t mode, Custody& ba // NOTE: If resolve_path fails with a non-null parent custody, the error should be ENOENT. VERIFY(result.error().code() == ENOENT); + TRY(validate_path_against_process_veil(*parent_custody, O_CREAT)); auto& parent_inode = parent_custody->inode(); auto& current_process = Process::current(); if (!parent_inode.metadata().may_write(current_process))