]> git.baikalelectronics.ru Git - kernel.git/commit
kasan, arm64: fix pointer tags in KASAN reports
authorAndrey Konovalov <andreyknvl@google.com>
Fri, 15 Jan 2021 17:41:53 +0000 (18:41 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 18 Jan 2021 18:15:49 +0000 (18:15 +0000)
commit24d34120d8f902dc3d15539e27c5f60ef5ca6c3d
tree52544ae5eeb8a9e27a593c5cc41ff3ebe5cb5a36
parent4d17ea83174f0c47efa7d131d1fce457f6c91981
kasan, arm64: fix pointer tags in KASAN reports

As of the "arm64: expose FAR_EL1 tag bits in siginfo" patch, the address
that is passed to report_tag_fault has pointer tags in the format of 0x0X,
while KASAN uses 0xFX format (note the difference in the top 4 bits).

Fix up the pointer tag for kernel pointers in do_tag_check_fault by
setting them to the same value as bit 55. Explicitly use __untagged_addr()
instead of untagged_addr(), as the latter doesn't affect TTBR1 addresses.

Fixes: 708192a5dbf3 ("arm64: expose FAR_EL1 tag bits in siginfo")
Fixes: 6e7084ddbfcb ("kasan, arm64: print report from tag fault handler")
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://linux-review.googlesource.com/id/I9ced973866036d8679e8f4ae325de547eb969649
Link: https://lore.kernel.org/r/ff30b0afe6005fd046f9ac72bfb71822aedccd89.1610731872.git.andreyknvl@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/fault.c