OSDN Git Service

xtensa: fix TLB sanity checker
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 13 Nov 2019 21:18:31 +0000 (13:18 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 09:57:25 +0000 (10:57 +0100)
commit2f5d27ddbfe036430650c222fde04a2a3fadc132
tree3a471d181a7cee835cbb5aab2623d7f0fba61e52
parentdc6f9b00b9194be813011d8ab071471fb0283e61
xtensa: fix TLB sanity checker

commit 36de10c4788efc6efe6ff9aa10d38cb7eea4c818 upstream.

Virtual and translated addresses retrieved by the xtensa TLB sanity
checker must be consistent, i.e. correspond to the same state of the
checked TLB entry. KASAN shadow memory is mapped dynamically using
auto-refill TLB entries and thus may change TLB state between the
virtual and translated address retrieval, resulting in false TLB
insanity report.
Move read_xtlb_translation close to read_xtlb_virtual to make sure that
read values are consistent.

Cc: stable@vger.kernel.org
Fixes: a99e07ee5e88 ("xtensa: check TLB sanity on return to userspace")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/xtensa/mm/tlb.c