Skip to content

Commit b31459a

Browse files
tixyRussell King
authored andcommitted
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>
1 parent 3abb667 commit b31459a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/arm/kernel/traps.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,10 @@ static inline int
509509
__do_cache_op(unsigned long start, unsigned long end)
510510
{
511511
int ret;
512-
unsigned long chunk = PAGE_SIZE;
513512

514513
do {
514+
unsigned long chunk = min(PAGE_SIZE, end - start);
515+
515516
if (signal_pending(current)) {
516517
struct thread_info *ti = current_thread_info();
517518

0 commit comments

Comments
 (0)