Skip to content

Commit

Permalink
arm64: Fix for the arm64 kern_addr_valid() function
Browse files Browse the repository at this point in the history
Fix for the arm64 kern_addr_valid() function to recognize
virtual addresses in the kernel logical memory map.  The
function fails as written because it does not check whether
the addresses in that region are mapped at the pmd level to
2MB or 512MB pages, continues the page table walk to the
pte level, and issues a garbage value to pfn_valid().

Tested on 4K-page and 64K-page kernels.

Signed-off-by: Dave Anderson <anderson@redhat.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Dave Anderson authored and Catalin Marinas committed May 3, 2014
1 parent d1db0ee commit da6e4cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm64/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ int kern_addr_valid(unsigned long addr)
if (pmd_none(*pmd))
return 0;

if (pmd_sect(*pmd))
return pfn_valid(pmd_pfn(*pmd));

pte = pte_offset_kernel(pmd, addr);
if (pte_none(*pte))
return 0;
Expand Down

0 comments on commit da6e4cb

Please sign in to comment.