diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-08 12:33:36 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-08 12:47:37 +0100 |
commit | 50056d1d84f654043b8f4401135ec3ec08a3478c (patch) | |
tree | 84c13402b68b0e1b0117ba77fe17af7e4fa1b7ea /Kernel | |
parent | 3f35cd2f7d9ca60188b3b057cdb2ba23f050d745 (diff) | |
download | serenity-50056d1d84f654043b8f4401135ec3ec08a3478c.zip |
Kernel: mmap() should fail with ENODEV for directories
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 6dab0e51b6..4fef1e77ff 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -339,6 +339,8 @@ void* Process::sys$mmap(const Syscall::SC_mmap_params* user_params) auto description = file_description(fd); if (!description) return (void*)-EBADF; + if (description->is_directory()) + return (void*)-ENODEV; if ((prot & PROT_READ) && !description->is_readable()) return (void*)-EACCES; if ((prot & PROT_WRITE) && !description->is_writable()) |