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:
Augustin Cavalier
2025-03-12 08:28:29 -04:00
parent 70c25855f4
commit 282c3b6e08
+1
View File
@@ -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) {