diff options
author | Liav A <liavalb@gmail.com> | 2022-09-24 15:10:13 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2022-09-26 20:00:34 +0300 |
commit | 60b088b89a74af0a346a318c435113b22df53755 (patch) | |
tree | b4833e6e1d9516237f6d95318753360d877c0041 /Kernel/Memory/PageFaultResponse.h | |
parent | 69f7a59a347711879dfa76b922cb78a5c69f8f18 (diff) | |
download | serenity-60b088b89a74af0a346a318c435113b22df53755.zip |
Kernel: Send SIGBUS to threads that use after valid Inode mmaped range
According to Dr. POSIX, we should allow to call mmap on inodes even on
ranges that currently don't map to any actual data. Trying to read or
write to those ranges should result in SIGBUS being sent to the thread
that did violating memory access.
To implement this restriction, we simply check if the result of
read_bytes on an Inode returns 0, which means we have nothing valid to
map to the program, hence it should receive a SIGBUS in that case.
Diffstat (limited to 'Kernel/Memory/PageFaultResponse.h')
-rw-r--r-- | Kernel/Memory/PageFaultResponse.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/Memory/PageFaultResponse.h b/Kernel/Memory/PageFaultResponse.h index 56297f6268..0a5c473230 100644 --- a/Kernel/Memory/PageFaultResponse.h +++ b/Kernel/Memory/PageFaultResponse.h @@ -10,6 +10,7 @@ namespace Kernel { enum class PageFaultResponse { ShouldCrash, + BusError, OutOfMemory, Continue, }; |