* [PATCH RESEND] arm: don't break misaligned NEON load/store
@ 2014-09-22 13:48 Robin Murphy
2014-09-25 11:05 ` Robin Murphy
0 siblings, 1 reply; 2+ messages in thread
From: Robin Murphy @ 2014-09-22 13:48 UTC (permalink / raw)
To: linux-arm-kernel
The alignment fixup incorrectly decodes faulting ARM VLDn/VSTn
instructions (where the optional alignment hint is given but incorrect)
as LDR/STR, leading to register corruption. Detect these and correctly
treat them as unhandled, so that userspace gets the fault it expects.
Reported-by: Simon Hosie <simon.hosie@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Cc: <stable@vger.kernel.org>
---
Hi all,
This was met with a resounding silence a while back[1], but the bug is
still causing annoyance - apparently Clang intrinsics can be a little
over-eager with alignment hints. Regardless of whose fault that is,
the kernel shouldn't be silently mangling registers unexpectedly.
Any objections to me dropping this into the patch system?
Robin.
[1]:http://www.spinics.net/lists/arm-kernel/msg328889.html
arch/arm/mm/alignment.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 0c1ab49..83792f4 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -41,6 +41,7 @@
* This code is not portable to processors with late data abort handling.
*/
#define CODING_BITS(i) (i & 0x0e000000)
+#define COND_BITS(i) (i & 0xf0000000)
#define LDST_I_BIT(i) (i & (1 << 26)) /* Immediate constant */
#define LDST_P_BIT(i) (i & (1 << 24)) /* Preindex */
@@ -821,6 +822,8 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
break;
case 0x04000000: /* ldr or str immediate */
+ if (COND_BITS(instr) == 0xf0000000) /* NEON VLDn, VSTn */
+ goto bad;
offset.un = OFFSET_BITS(instr);
handler = do_alignment_ldrstr;
break;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH RESEND] arm: don't break misaligned NEON load/store
2014-09-22 13:48 [PATCH RESEND] arm: don't break misaligned NEON load/store Robin Murphy
@ 2014-09-25 11:05 ` Robin Murphy
0 siblings, 0 replies; 2+ messages in thread
From: Robin Murphy @ 2014-09-25 11:05 UTC (permalink / raw)
To: linux-arm-kernel
On 22/09/14 14:48, Robin Murphy wrote:
> The alignment fixup incorrectly decodes faulting ARM VLDn/VSTn
> instructions (where the optional alignment hint is given but incorrect)
> as LDR/STR, leading to register corruption. Detect these and correctly
> treat them as unhandled, so that userspace gets the fault it expects.
>
> Reported-by: Simon Hosie <simon.hosie@arm.com>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> Cc: <stable@vger.kernel.org>
> ---
>
> Hi all,
>
> This was met with a resounding silence a while back[1], but the bug is
> still causing annoyance - apparently Clang intrinsics can be a little
> over-eager with alignment hints. Regardless of whose fault that is,
> the kernel shouldn't be silently mangling registers unexpectedly.
>
> Any objections to me dropping this into the patch system?
>
Since nobody's voiced any complaints, I've submitted this as 8165/1.
Robin.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-25 11:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22 13:48 [PATCH RESEND] arm: don't break misaligned NEON load/store Robin Murphy
2014-09-25 11:05 ` Robin Murphy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.