Commit 2925f142 authored by Jon Medhurst's avatar Jon Medhurst Committed by Greg Kroah-Hartman

ARM: 7917/1: cacheflush: correctly limit range of memory region being flushed

commit b31459ad upstream.

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.
Reported-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarJon Medhurst <tixy@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 56e97506
......@@ -503,9 +503,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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment