fix: kernel and desktop bug fixes

This commit is contained in:
2026-05-14 11:31:14 +02:00
parent a7ff1f0a72
commit bb12aeb9b9
11 changed files with 507 additions and 106 deletions
+11
View File
@@ -143,6 +143,17 @@ namespace Memory {
return;
}
// Overlap check: the new region must end at or before `current` starts.
// The previous double-free guards only matched single-page overlaps;
// freeing a multi-page span that overlaps the start of an existing
// block would silently corrupt the free list.
if (current != nullptr && addr + size > (uint64_t)current) {
Kt::KernelLogStream(Kt::WARNING, "PFA")
<< "Overlapping free at " << addr << " size " << size << ", ignoring";
Lock.Release();
return;
}
// Try to coalesce with previous block (if prev ends where new block starts)
bool merged_prev = false;
if (prev != &head) {