ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses
authorDouglas Anderson <dianders@chromium.org>
Thu, 6 Aug 2020 22:24:35 +0000 (23:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:06:53 +0000 (11:06 +0100)
commit3011217e2975d674d6f5f565697fee2586cbe682
treea54ed0f01011e722ff2b5c6097e387f7a9c3fe7b
parent9368f119e8c350cc2576327060fa535872421b4a
ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses

[ Upstream commit 22c9e58299e5f18274788ce54c03d4fb761e3c5d ]

This is commit fdfeff0f9e3d ("arm64: hw_breakpoint: Handle inexact
watchpoint addresses") but ported to arm32, which has the same
problem.

This problem was found by Android CTS tests, notably the
"watchpoint_imprecise" test [1].  I tested locally against a copycat
(simplified) version of the test though.

[1] https://android.googlesource.com/platform/bionic/+/master/tests/sys_ptrace_test.cpp

Link: https://lkml.kernel.org/r/20191019111216.1.I82eae759ca6dc28a245b043f485ca490e3015321@changeid
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/kernel/hw_breakpoint.c