From: Jon Medhurst Date: Mon, 9 Dec 2013 12:45:46 +0000 (+0100) Subject: ARM: 7917/1: cacheflush: correctly limit range of memory region being flushed X-Git-Tag: v3.13-rc4~9^2~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b31459adeab018b297541e288ac88873011da82a;p=~emulex%2Finfiniband.git 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: Reported-by: Christian Gmeiner Tested-by: Christian Gmeiner Acked-by: Will Deacon Signed-off-by: Jon Medhurst Signed-off-by: Russell King --- diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index dbf0923e8d7..7940241f057 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();