diff options
author | Shyam Thombre <sthombre@codeaurora.org> | 2020-06-10 16:39:44 +0530 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-06-15 16:58:13 +0100 |
commit | 8dd4daa04278d7437641962ed53b843c0b0ec4a9 (patch) | |
tree | 940b7e1e853326ce5c4bda070c79c52634f009de /arch | |
parent | 413d3ea6b775d77b2057f13a9af75875eb066156 (diff) |
arm64: mm: reset address tag set by kasan sw tagging
KASAN sw tagging sets a random tag of 8 bits in the top byte of the pointer
returned by the memory allocating functions. So for the functions unaware
of this change, the top 8 bits of the address must be reset which is done
by the function arch_kasan_reset_tag().
Signed-off-by: Shyam Thombre <sthombre@codeaurora.org>
Link: https://lore.kernel.org/r/1591787384-5823-1-git-send-email-sthombre@codeaurora.org
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/mm/mmu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 990929c8837e..1df25f26571d 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -723,6 +723,7 @@ int kern_addr_valid(unsigned long addr) pmd_t *pmdp, pmd; pte_t *ptep, pte; + addr = arch_kasan_reset_tag(addr); if ((((long)addr) >> VA_BITS) != -1UL) return 0; |