summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2013-12-09 13:45:46 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-12-10 00:24:35 +0100
commitb31459adeab018b297541e288ac88873011da82a (patch)
treeeca8de340db8e002f3c53a1cf1fe8d3272951a2c /arch
parentARM: 7913/1: fix framepointer check in unwind_frame (diff)
downloadlinux-b31459adeab018b297541e288ac88873011da82a.tar.xz
linux-b31459adeab018b297541e288ac88873011da82a.zip
ARM: 7917/1: cacheflush: correctly limit range of memory region being flushed
The __do_cache_op function operates with a 'chunk' size of one page but fails to limit the size of the final chunk so as to not exceed the specified memory region. Fix this. Cc: <stable@vger.kernel.org> Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com> Tested-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Jon Medhurst <tixy@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/traps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index dbf0923e8d76..7940241f0576 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -509,9 +509,10 @@ static inline int
__do_cache_op(unsigned long start, unsigned long end)
{
int ret;
- unsigned long chunk = PAGE_SIZE;
do {
+ unsigned long chunk = min(PAGE_SIZE, end - start);
+
if (signal_pending(current)) {
struct thread_info *ti = current_thread_info();