bugfix: 解决取消低地址映射时,错误的把重映射的物理页释放,从而导致的use after free问题。 (#321)

This commit is contained in:
LoGin
2023-08-07 01:38:52 +08:00
committed by GitHub
parent 729a96ef47
commit 26887c6334
6 changed files with 22 additions and 15 deletions

View File

@ -610,10 +610,10 @@ impl LowAddressRemapping {
assert!(mapper.as_mut().is_some());
for i in 0..(Self::REMAP_SIZE / MMArch::PAGE_SIZE) {
let vaddr = VirtAddr::new(i * MMArch::PAGE_SIZE);
let flusher = mapper
let (_, _, flusher) = mapper
.as_mut()
.unwrap()
.unmap(vaddr, true)
.unmap_phys(vaddr, true)
.expect("Failed to unmap frame");
if flush == false {
flusher.ignore();