[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1518323471.111126904@decadent.org.uk>
Date: Sun, 11 Feb 2018 04:31:11 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org,
"Catalin Marinas" <catalin.marinas@....com>,
"Mark Salyzyn" <salyzyn@...roid.com>,
"Will Deacon" <will.deacon@....com>,
"Andrew Pinski" <apinski@...ium.com>,
"Mark Rutland" <mark.rutland@....com>
Subject: [PATCH 3.16 041/136] arm64: vdso: fix clock_getres for
4GiB-aligned res
3.16.54-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <mark.rutland@....com>
commit c80ed088a519da53f27b798a69748eaabc66aadf upstream.
The vdso tries to check for a NULL res pointer in __kernel_clock_getres,
but only checks the lower 32 bits as is uses CBZ on the W register the
res pointer is held in.
Thus, if the res pointer happened to be aligned to a 4GiB boundary, we'd
spuriously skip storing the timespec to it, while returning a zero error code
to the caller.
Prevent this by checking the whole pointer, using CBZ on the X register
the res pointer is held in.
Fixes: 9031fefde6f2ac1d ("arm64: VDSO support")
Signed-off-by: Mark Rutland <mark.rutland@....com>
Reported-by: Andrew Pinski <apinski@...ium.com>
Reported-by: Mark Salyzyn <salyzyn@...roid.com>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Will Deacon <will.deacon@....com>
Signed-off-by: Will Deacon <will.deacon@....com>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
arch/arm64/kernel/vdso/gettimeofday.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm64/kernel/vdso/gettimeofday.S
+++ b/arch/arm64/kernel/vdso/gettimeofday.S
@@ -186,7 +186,7 @@ ENTRY(__kernel_clock_getres)
b.ne 4f
ldr x2, 6f
2:
- cbz w1, 3f
+ cbz x1, 3f
stp xzr, x2, [x1]
3: /* res == NULL. */
Powered by blists - more mailing lists