mirror of
https://github.com/RGBCube/serenity
synced 2025-07-22 21:57:35 +00: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
1 changed files with 6 additions and 0 deletions
|
@ -378,6 +378,12 @@ bool Region::map(PageDirectory& page_directory)
|
||||||
{
|
{
|
||||||
ScopedSpinLock lock(s_mm_lock);
|
ScopedSpinLock lock(s_mm_lock);
|
||||||
ScopedSpinLock page_lock(page_directory.get_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);
|
set_page_directory(page_directory);
|
||||||
size_t page_index = 0;
|
size_t page_index = 0;
|
||||||
while (page_index < page_count()) {
|
while (page_index < page_count()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue