kernel/slab: Set write protection on MemoryManager areas.
The MemoryManager maps and unmaps pages manually, so this isn't strictly necessary, but it helps with memory accounting in e.g. ProcessController. Fixes the kernel_team disappearing from ProcessController's list (and also having too-low memory amounts) as noticed in #19460.
This commit is contained in:
@@ -1335,6 +1335,7 @@ MemoryManager::_AllocateArea(uint32 flags, Area*& _area)
|
||||
(addr_t)area, (addr_t)areaBase + SLAB_AREA_SIZE - 1);
|
||||
|
||||
vmArea = VMAreas::Lookup(areaID);
|
||||
vmArea->protection = B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA;
|
||||
status_t error = _MapChunk(vmArea, (addr_t)area, kAreaAdminSize,
|
||||
pagesNeededToMap, flags);
|
||||
if (error != B_OK) {
|
||||
|
||||
Reference in New Issue
Block a user