Re: [PATCH v3.18.y 1/2] arm64: hw_breakpoint: fix watchpoint matching for tagged pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 06, 2017 at 08:12:48PM +0100, Kristina Martsenko wrote:
> commit 7dcd9dd8cebe9fa626af7e2358d03a37041a70fb upstream.
> 
> This backport has a few small differences from the upstream commit:
>  - The address tag is removed in watchpoint_handler() instead of
>    get_distance_from_watchpoint(), because 3.18 does not have commit
>    fdfeff0f9e3d ("arm64: hw_breakpoint: Handle inexact watchpoint
>    addresses").
>  - Two macros are backported (untagged_addr, sign_extend64), as they are
>    not present in 3.18.
> 
> Original patch description:
> 
> When we take a watchpoint exception, the address that triggered the
> watchpoint is found in FAR_EL1. We compare it to the address of each
> configured watchpoint to see which one was hit.
> 
> The configured watchpoint addresses are untagged, while the address in
> FAR_EL1 will have an address tag if the data access was done using a
> tagged address. The tag needs to be removed to compare the address to
> the watchpoints.
> 
> Currently we don't remove it, and as a result can report the wrong
> watchpoint as being hit (specifically, always either the highest TTBR0
> watchpoint or lowest TTBR1 watchpoint). This patch removes the tag.
> 
> Fixes: d50240a5f6ce ("arm64: mm: permit use of tagged pointers at EL0")
> Cc: <stable@xxxxxxxxxxxxxxx> # 3.12.x-
> Acked-by: Mark Rutland <mark.rutland@xxxxxxx>
> Acked-by: Will Deacon <will.deacon@xxxxxxx>
> Signed-off-by: Kristina Martsenko <kristina.martsenko@xxxxxxx>
> Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
> ---
> 
> Sending this for v3.18 as it still seems active despite being EOL.

Yeah, it is "officially", but there are a few million devices out there
in the wild running 3.18 and I'm trying to keep them up to date as much
as I can, before I eventually just give up...

thanks for the patches, both now queued up.

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]