x86: fix crash in _arch_buffer_validate
The code wasn't checking if the memory address to check corresponded to a non-present page directory pointer table entry. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
9af5089dee
commit
62d866385e
1 changed files with 5 additions and 0 deletions
|
@ -88,6 +88,11 @@ int _arch_buffer_validate(void *addr, size_t size, int write)
|
|||
end_pde_num = MMU_PDE_NUM((char *)addr + size - 1);
|
||||
}
|
||||
|
||||
/* Ensure page directory pointer table entry is present */
|
||||
if (X86_MMU_GET_PDPTE_INDEX(&USER_PDPT, pdpte)->p == 0) {
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
struct x86_mmu_pd *pd_address =
|
||||
X86_MMU_GET_PD_ADDR_INDEX(&USER_PDPT, pdpte);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue