Skip to content

Commit

Permalink
ARM: 7917/1: cacheflush: correctly limit range of memory region being…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Jon Medhurst authored and Russell King committed Dec 9, 2013
1 parent 3abb667 commit b31459a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit b31459a

Please sign in to comment.