Skip to content

Commit

Permalink
arm64: memory: fix flipped VA space fallout
Browse files Browse the repository at this point in the history
VA_START used to be the start of the TTBR1 address space, but now it's a
point midway though. In a couple of places we still use VA_START to get
the start of the TTBR1 address space, so let's fix these up to use
PAGE_OFFSET instead.

Fixes: 14c127c ("arm64: mm: Flip kernel VA space")
Signed-off-by: Mark Rutland <[email protected]>
Cc: Catalin Marinas <[email protected]>
Tested-by: Steve Capper <[email protected]>
Reviewed-by: Steve Capper <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
Mark Rutland authored and willdeacon committed Aug 14, 2019
1 parent d0b3c32 commit 233947e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/arm64/mm/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ void ptdump_check_wx(void)
.check_wx = true,
};

walk_pgd(&st, &init_mm, VA_START);
walk_pgd(&st, &init_mm, PAGE_OFFSET);
note_page(&st, 0, 0, 0);
if (st.wx_pages || st.uxn_pages)
pr_warn("Checked W+X mappings: FAILED, %lu W+X pages found, %lu non-UXN pages found\n",
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static inline bool is_ttbr0_addr(unsigned long addr)
static inline bool is_ttbr1_addr(unsigned long addr)
{
/* TTBR1 addresses may have a tag if KASAN_SW_TAGS is in use */
return arch_kasan_reset_tag(addr) >= VA_START;
return arch_kasan_reset_tag(addr) >= PAGE_OFFSET;
}

/*
Expand Down

0 comments on commit 233947e

Please sign in to comment.