* [PATCH v4.9.y 2/3] arm64: hw_breakpoint: fix watchpoint matching for tagged pointers
2017-06-06 19:14 [PATCH v4.9.y 1/3] arm64: traps: fix userspace cache maintenance emulation on a tagged pointer Kristina Martsenko
@ 2017-06-06 19:14 ` Kristina Martsenko
2017-06-12 13:44 ` Patch "arm64: hw_breakpoint: fix watchpoint matching for tagged pointers" has been added to the 4.9-stable tree gregkh
2017-06-06 19:14 ` [PATCH v4.9.y 3/3] arm64: entry: improve data abort handling of tagged pointers Kristina Martsenko
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Kristina Martsenko @ 2017-06-06 19:14 UTC (permalink / raw)
To: stable; +Cc: Will Deacon, Catalin Marinas
commit 7dcd9dd8cebe9fa626af7e2358d03a37041a70fb upstream.
This backport has a small difference from the upstream commit:
- The address tag is removed in watchpoint_handler() instead of
get_distance_from_watchpoint(), because 4.9 does not have commit
fdfeff0f9e3d ("arm64: hw_breakpoint: Handle inexact watchpoint
addresses").
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@vger.kernel.org> # 3.12.x-
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
arch/arm64/include/asm/uaccess.h | 6 +++---
arch/arm64/kernel/hw_breakpoint.c | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 14cca10aeb4e..811cf16a65f9 100644
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@ -105,9 +105,9 @@ static inline void set_fs(mm_segment_t fs)
})
/*
- * When dealing with data aborts or instruction traps we may end up with
- * a tagged userland pointer. Clear the tag to get a sane pointer to pass
- * on to access_ok(), for instance.
+ * When dealing with data aborts, watchpoints, or instruction traps we may end
+ * up with a tagged userland pointer. Clear the tag to get a sane pointer to
+ * pass on to access_ok(), for instance.
*/
#define untagged_addr(addr) sign_extend64(addr, 55)
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index 948b73148d56..0b9e5f6290f9 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -36,6 +36,7 @@
#include <asm/traps.h>
#include <asm/cputype.h>
#include <asm/system_misc.h>
+#include <asm/uaccess.h>
/* Breakpoint currently in use for each BRP. */
static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[ARM_MAX_BRP]);
@@ -696,7 +697,7 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr,
/* Check if the watchpoint value matches. */
val = read_wb_reg(AARCH64_DBG_REG_WVR, i);
- if (val != (addr & ~alignment_mask))
+ if (val != (untagged_addr(addr) & ~alignment_mask))
goto unlock;
/* Possible match, check the byte address select to confirm. */
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Patch "arm64: hw_breakpoint: fix watchpoint matching for tagged pointers" has been added to the 4.9-stable tree
2017-06-06 19:14 ` [PATCH v4.9.y 2/3] arm64: hw_breakpoint: fix watchpoint matching for tagged pointers Kristina Martsenko
@ 2017-06-12 13:44 ` gregkh
0 siblings, 0 replies; 7+ messages in thread
From: gregkh @ 2017-06-12 13:44 UTC (permalink / raw)
To: kristina.martsenko, catalin.marinas, gregkh, mark.rutland,
will.deacon
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
arm64: hw_breakpoint: fix watchpoint matching for tagged pointers
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arm64-hw_breakpoint-fix-watchpoint-matching-for-tagged-pointers.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From kristina.martsenko@arm.com Mon Jun 12 15:05:21 2017
From: Kristina Martsenko <kristina.martsenko@arm.com>
Date: Tue, 6 Jun 2017 20:14:09 +0100
Subject: arm64: hw_breakpoint: fix watchpoint matching for tagged pointers
To: stable@vger.kernel.org
Cc: Will Deacon <will.deacon@arm.com>, Catalin Marinas <catalin.marinas@arm.com>
Message-ID: <1496776450-8731-2-git-send-email-kristina.martsenko@arm.com>
From: Kristina Martsenko <kristina.martsenko@arm.com>
commit 7dcd9dd8cebe9fa626af7e2358d03a37041a70fb upstream.
This backport has a small difference from the upstream commit:
- The address tag is removed in watchpoint_handler() instead of
get_distance_from_watchpoint(), because 4.9 does not have commit
fdfeff0f9e3d ("arm64: hw_breakpoint: Handle inexact watchpoint
addresses").
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")
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/include/asm/uaccess.h | 6 +++---
arch/arm64/kernel/hw_breakpoint.c | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@ -105,9 +105,9 @@ static inline void set_fs(mm_segment_t f
})
/*
- * When dealing with data aborts or instruction traps we may end up with
- * a tagged userland pointer. Clear the tag to get a sane pointer to pass
- * on to access_ok(), for instance.
+ * When dealing with data aborts, watchpoints, or instruction traps we may end
+ * up with a tagged userland pointer. Clear the tag to get a sane pointer to
+ * pass on to access_ok(), for instance.
*/
#define untagged_addr(addr) sign_extend64(addr, 55)
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -36,6 +36,7 @@
#include <asm/traps.h>
#include <asm/cputype.h>
#include <asm/system_misc.h>
+#include <asm/uaccess.h>
/* Breakpoint currently in use for each BRP. */
static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[ARM_MAX_BRP]);
@@ -696,7 +697,7 @@ static int watchpoint_handler(unsigned l
/* Check if the watchpoint value matches. */
val = read_wb_reg(AARCH64_DBG_REG_WVR, i);
- if (val != (addr & ~alignment_mask))
+ if (val != (untagged_addr(addr) & ~alignment_mask))
goto unlock;
/* Possible match, check the byte address select to confirm. */
Patches currently in stable-queue which might be from kristina.martsenko@arm.com are
queue-4.9/arm64-hw_breakpoint-fix-watchpoint-matching-for-tagged-pointers.patch
queue-4.9/arm64-entry-improve-data-abort-handling-of-tagged-pointers.patch
queue-4.9/arm64-traps-fix-userspace-cache-maintenance-emulation-on-a-tagged-pointer.patch
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4.9.y 3/3] arm64: entry: improve data abort handling of tagged pointers
2017-06-06 19:14 [PATCH v4.9.y 1/3] arm64: traps: fix userspace cache maintenance emulation on a tagged pointer Kristina Martsenko
2017-06-06 19:14 ` [PATCH v4.9.y 2/3] arm64: hw_breakpoint: fix watchpoint matching for tagged pointers Kristina Martsenko
@ 2017-06-06 19:14 ` Kristina Martsenko
2017-06-12 13:44 ` Patch "arm64: entry: improve data abort handling of tagged pointers" has been added to the 4.9-stable tree gregkh
2017-06-12 13:06 ` [PATCH v4.9.y 1/3] arm64: traps: fix userspace cache maintenance emulation on a tagged pointer Greg KH
2017-06-12 13:44 ` Patch "arm64: traps: fix userspace cache maintenance emulation on a tagged pointer" has been added to the 4.9-stable tree gregkh
3 siblings, 1 reply; 7+ messages in thread
From: Kristina Martsenko @ 2017-06-06 19:14 UTC (permalink / raw)
To: stable; +Cc: Will Deacon, Catalin Marinas
commit 276e93279a630657fff4b086ba14c95955912dfa upstream.
This backport has a minor difference from the upstream commit: it adds
the asm-uaccess.h file, which is not present in 4.9, because 4.9 does
not have commit b4b8664d291a ("arm64: don't pull uaccess.h into *.S").
Original patch description:
When handling a data abort from EL0, we currently zero the top byte of
the faulting address, as we assume the address is a TTBR0 address, which
may contain a non-zero address tag. However, the address may be a TTBR1
address, in which case we should not zero the top byte. This patch fixes
that. The effect is that the full TTBR1 address is passed to the task's
signal handler (or printed out in the kernel log).
When handling a data abort from EL1, we leave the faulting address
intact, as we assume it's either a TTBR1 address or a TTBR0 address with
tag 0x00. This is true as far as I'm aware, we don't seem to access a
tagged TTBR0 address anywhere in the kernel. Regardless, it's easy to
forget about address tags, and code added in the future may not always
remember to remove tags from addresses before accessing them. So add tag
handling to the EL1 data abort handler as well. This also makes it
consistent with the EL0 data abort handler.
Fixes: d50240a5f6ce ("arm64: mm: permit use of tagged pointers at EL0")
Cc: <stable@vger.kernel.org> # 3.12.x-
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
arch/arm64/include/asm/asm-uaccess.h | 13 +++++++++++++
arch/arm64/kernel/entry.S | 6 ++++--
2 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 arch/arm64/include/asm/asm-uaccess.h
diff --git a/arch/arm64/include/asm/asm-uaccess.h b/arch/arm64/include/asm/asm-uaccess.h
new file mode 100644
index 000000000000..be2d2347d995
--- /dev/null
+++ b/arch/arm64/include/asm/asm-uaccess.h
@@ -0,0 +1,13 @@
+#ifndef __ASM_ASM_UACCESS_H
+#define __ASM_ASM_UACCESS_H
+
+/*
+ * Remove the address tag from a virtual address, if present.
+ */
+ .macro clear_address_tag, dst, addr
+ tst \addr, #(1 << 55)
+ bic \dst, \addr, #(0xff << 56)
+ csel \dst, \dst, \addr, eq
+ .endm
+
+#endif
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 79b0fe24d5b7..b4c7db434654 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -30,6 +30,7 @@
#include <asm/irq.h>
#include <asm/memory.h>
#include <asm/thread_info.h>
+#include <asm/asm-uaccess.h>
#include <asm/unistd.h>
/*
@@ -369,12 +370,13 @@ el1_da:
/*
* Data abort handling
*/
- mrs x0, far_el1
+ mrs x3, far_el1
enable_dbg
// re-enable interrupts if they were enabled in the aborted context
tbnz x23, #7, 1f // PSR_I_BIT
enable_irq
1:
+ clear_address_tag x0, x3
mov x2, sp // struct pt_regs
bl do_mem_abort
@@ -535,7 +537,7 @@ el0_da:
// enable interrupts before calling the main handler
enable_dbg_and_irq
ct_user_exit
- bic x0, x26, #(0xff << 56)
+ clear_address_tag x0, x26
mov x1, x25
mov x2, sp
bl do_mem_abort
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Patch "arm64: entry: improve data abort handling of tagged pointers" has been added to the 4.9-stable tree
2017-06-06 19:14 ` [PATCH v4.9.y 3/3] arm64: entry: improve data abort handling of tagged pointers Kristina Martsenko
@ 2017-06-12 13:44 ` gregkh
0 siblings, 0 replies; 7+ messages in thread
From: gregkh @ 2017-06-12 13:44 UTC (permalink / raw)
To: kristina.martsenko, Dave.Martin, catalin.marinas, gregkh,
will.deacon
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
arm64: entry: improve data abort handling of tagged pointers
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arm64-entry-improve-data-abort-handling-of-tagged-pointers.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From kristina.martsenko@arm.com Mon Jun 12 15:05:37 2017
From: Kristina Martsenko <kristina.martsenko@arm.com>
Date: Tue, 6 Jun 2017 20:14:10 +0100
Subject: arm64: entry: improve data abort handling of tagged pointers
To: stable@vger.kernel.org
Cc: Will Deacon <will.deacon@arm.com>, Catalin Marinas <catalin.marinas@arm.com>
Message-ID: <1496776450-8731-3-git-send-email-kristina.martsenko@arm.com>
From: Kristina Martsenko <kristina.martsenko@arm.com>
commit 276e93279a630657fff4b086ba14c95955912dfa upstream.
This backport has a minor difference from the upstream commit: it adds
the asm-uaccess.h file, which is not present in 4.9, because 4.9 does
not have commit b4b8664d291a ("arm64: don't pull uaccess.h into *.S").
Original patch description:
When handling a data abort from EL0, we currently zero the top byte of
the faulting address, as we assume the address is a TTBR0 address, which
may contain a non-zero address tag. However, the address may be a TTBR1
address, in which case we should not zero the top byte. This patch fixes
that. The effect is that the full TTBR1 address is passed to the task's
signal handler (or printed out in the kernel log).
When handling a data abort from EL1, we leave the faulting address
intact, as we assume it's either a TTBR1 address or a TTBR0 address with
tag 0x00. This is true as far as I'm aware, we don't seem to access a
tagged TTBR0 address anywhere in the kernel. Regardless, it's easy to
forget about address tags, and code added in the future may not always
remember to remove tags from addresses before accessing them. So add tag
handling to the EL1 data abort handler as well. This also makes it
consistent with the EL0 data abort handler.
Fixes: d50240a5f6ce ("arm64: mm: permit use of tagged pointers at EL0")
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/include/asm/asm-uaccess.h | 13 +++++++++++++
arch/arm64/kernel/entry.S | 6 ++++--
2 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 arch/arm64/include/asm/asm-uaccess.h
--- /dev/null
+++ b/arch/arm64/include/asm/asm-uaccess.h
@@ -0,0 +1,13 @@
+#ifndef __ASM_ASM_UACCESS_H
+#define __ASM_ASM_UACCESS_H
+
+/*
+ * Remove the address tag from a virtual address, if present.
+ */
+ .macro clear_address_tag, dst, addr
+ tst \addr, #(1 << 55)
+ bic \dst, \addr, #(0xff << 56)
+ csel \dst, \dst, \addr, eq
+ .endm
+
+#endif
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -30,6 +30,7 @@
#include <asm/irq.h>
#include <asm/memory.h>
#include <asm/thread_info.h>
+#include <asm/asm-uaccess.h>
#include <asm/unistd.h>
/*
@@ -369,12 +370,13 @@ el1_da:
/*
* Data abort handling
*/
- mrs x0, far_el1
+ mrs x3, far_el1
enable_dbg
// re-enable interrupts if they were enabled in the aborted context
tbnz x23, #7, 1f // PSR_I_BIT
enable_irq
1:
+ clear_address_tag x0, x3
mov x2, sp // struct pt_regs
bl do_mem_abort
@@ -535,7 +537,7 @@ el0_da:
// enable interrupts before calling the main handler
enable_dbg_and_irq
ct_user_exit
- bic x0, x26, #(0xff << 56)
+ clear_address_tag x0, x26
mov x1, x25
mov x2, sp
bl do_mem_abort
Patches currently in stable-queue which might be from kristina.martsenko@arm.com are
queue-4.9/arm64-hw_breakpoint-fix-watchpoint-matching-for-tagged-pointers.patch
queue-4.9/arm64-entry-improve-data-abort-handling-of-tagged-pointers.patch
queue-4.9/arm64-traps-fix-userspace-cache-maintenance-emulation-on-a-tagged-pointer.patch
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4.9.y 1/3] arm64: traps: fix userspace cache maintenance emulation on a tagged pointer
2017-06-06 19:14 [PATCH v4.9.y 1/3] arm64: traps: fix userspace cache maintenance emulation on a tagged pointer Kristina Martsenko
2017-06-06 19:14 ` [PATCH v4.9.y 2/3] arm64: hw_breakpoint: fix watchpoint matching for tagged pointers Kristina Martsenko
2017-06-06 19:14 ` [PATCH v4.9.y 3/3] arm64: entry: improve data abort handling of tagged pointers Kristina Martsenko
@ 2017-06-12 13:06 ` Greg KH
2017-06-12 13:44 ` Patch "arm64: traps: fix userspace cache maintenance emulation on a tagged pointer" has been added to the 4.9-stable tree gregkh
3 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-06-12 13:06 UTC (permalink / raw)
To: Kristina Martsenko; +Cc: stable, Will Deacon, Catalin Marinas
On Tue, Jun 06, 2017 at 08:14:08PM +0100, Kristina Martsenko wrote:
> commit 81cddd65b5c82758ea5571a25e31ff6f1f89ff02 upstream.
>
> This backport has a minor difference from the upstream commit, as v4.9
> did not yet have the refactoring done by commit 8b6e70fccff2 ("arm64:
> traps: correctly handle MRS/MSR with XZR").
All 3 now applied, thanks for the backports.
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread* Patch "arm64: traps: fix userspace cache maintenance emulation on a tagged pointer" has been added to the 4.9-stable tree
2017-06-06 19:14 [PATCH v4.9.y 1/3] arm64: traps: fix userspace cache maintenance emulation on a tagged pointer Kristina Martsenko
` (2 preceding siblings ...)
2017-06-12 13:06 ` [PATCH v4.9.y 1/3] arm64: traps: fix userspace cache maintenance emulation on a tagged pointer Greg KH
@ 2017-06-12 13:44 ` gregkh
3 siblings, 0 replies; 7+ messages in thread
From: gregkh @ 2017-06-12 13:44 UTC (permalink / raw)
To: kristina.martsenko, catalin.marinas, gregkh, will.deacon
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
arm64: traps: fix userspace cache maintenance emulation on a tagged pointer
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arm64-traps-fix-userspace-cache-maintenance-emulation-on-a-tagged-pointer.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From kristina.martsenko@arm.com Mon Jun 12 15:04:11 2017
From: Kristina Martsenko <kristina.martsenko@arm.com>
Date: Tue, 6 Jun 2017 20:14:08 +0100
Subject: arm64: traps: fix userspace cache maintenance emulation on a tagged pointer
To: stable@vger.kernel.org
Cc: Will Deacon <will.deacon@arm.com>, Catalin Marinas <catalin.marinas@arm.com>
Message-ID: <1496776450-8731-1-git-send-email-kristina.martsenko@arm.com>
From: Kristina Martsenko <kristina.martsenko@arm.com>
commit 81cddd65b5c82758ea5571a25e31ff6f1f89ff02 upstream.
This backport has a minor difference from the upstream commit, as v4.9
did not yet have the refactoring done by commit 8b6e70fccff2 ("arm64:
traps: correctly handle MRS/MSR with XZR").
Original patch description:
When we emulate userspace cache maintenance in the kernel, we can
currently send the task a SIGSEGV even though the maintenance was done
on a valid address. This happens if the address has a non-zero address
tag, and happens to not be mapped in.
When we get the address from a user register, we don't currently remove
the address tag before performing cache maintenance on it. If the
maintenance faults, we end up in either __do_page_fault, where find_vma
can't find the VMA if the address has a tag, or in do_translation_fault,
where the tagged address will appear to be above TASK_SIZE. In both
cases, the address is not mapped in, and the task is sent a SIGSEGV.
This patch removes the tag from the address before using it. With this
patch, the fault is handled correctly, the address gets mapped in, and
the cache maintenance succeeds.
As a second bug, if cache maintenance (correctly) fails on an invalid
tagged address, the address gets passed into arm64_notify_segfault,
where find_vma fails to find the VMA due to the tag, and the wrong
si_code may be sent as part of the siginfo_t of the segfault. With this
patch, the correct si_code is sent.
Fixes: 7dd01aef0557 ("arm64: trap userspace "dc cvau" cache operation on errata-affected core")
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/kernel/traps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -435,7 +435,7 @@ int cpu_enable_cache_maint_trap(void *__
}
#define __user_cache_maint(insn, address, res) \
- if (untagged_addr(address) >= user_addr_max()) \
+ if (address >= user_addr_max()) \
res = -EFAULT; \
else \
asm volatile ( \
@@ -458,7 +458,7 @@ static void user_cache_maint_handler(uns
int crm = (esr & ESR_ELx_SYS64_ISS_CRM_MASK) >> ESR_ELx_SYS64_ISS_CRM_SHIFT;
int ret = 0;
- address = (rt == 31) ? 0 : regs->regs[rt];
+ address = (rt == 31) ? 0 : untagged_addr(regs->regs[rt]);
switch (crm) {
case ESR_ELx_SYS64_ISS_CRM_DC_CVAU: /* DC CVAU, gets promoted */
Patches currently in stable-queue which might be from kristina.martsenko@arm.com are
queue-4.9/arm64-hw_breakpoint-fix-watchpoint-matching-for-tagged-pointers.patch
queue-4.9/arm64-entry-improve-data-abort-handling-of-tagged-pointers.patch
queue-4.9/arm64-traps-fix-userspace-cache-maintenance-emulation-on-a-tagged-pointer.patch
^ permalink raw reply [flat|nested] 7+ messages in thread