mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Kernel: Assert on attempt to map private region backed by shared inode
If we find ourselves with a user-accessible, non-shared Region backed by a SharedInodeVMObject, that's pretty bad news, so let's just panic the kernel instead of getting abused. There might be a better place for this kind of check, so I've added a FIXME about putting more thought into that.
This commit is contained in:
parent
a131927c75
commit
3ff88a1d77
Notes:
sideshowbarker
2024-07-18 22:50:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3ff88a1d773
@ -378,6 +378,12 @@ bool Region::map(PageDirectory& page_directory)
|
||||
{
|
||||
ScopedSpinLock lock(s_mm_lock);
|
||||
ScopedSpinLock page_lock(page_directory.get_lock());
|
||||
|
||||
// FIXME: Find a better place for this sanity check(?)
|
||||
if (is_user_accessible() && !is_shared()) {
|
||||
ASSERT(!vmobject().is_shared_inode());
|
||||
}
|
||||
|
||||
set_page_directory(page_directory);
|
||||
size_t page_index = 0;
|
||||
while (page_index < page_count()) {
|
||||
|
Loading…
Reference in New Issue
Block a user