From 9165563b5e27443daf3b400f256b8273b54b1d49 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Fri, 15 Jul 2022 12:59:33 +0200 Subject: [PATCH] s390/crash: fix incorrect number of bytes to copy to user space [ Upstream commit 675228ddf44cd157e84657fdf0a10ed226ca7d24 ] The number of bytes in a chunk is correctly calculated, but instead the total number of bytes is passed to copy_to_user_real() function. Reported-by: Matthew Wilcox Fixes: 056ae38a45b2 ("s390/dump: streamline oldmem copy functions") Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin --- arch/s390/kernel/crash_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c index 199f136d1644e..f17ad2daab079 100644 --- a/arch/s390/kernel/crash_dump.c +++ b/arch/s390/kernel/crash_dump.c @@ -198,7 +198,7 @@ static int copy_oldmem_user(void __user *dst, unsigned long src, size_t count) } else { len = count; } - rc = copy_to_user_real(dst, src, count); + rc = copy_to_user_real(dst, src, len); if (rc) return rc; } -- 2.39.5