From: Alexander Gordeev Date: Fri, 15 Jul 2022 10:59:33 +0000 (+0200) Subject: s390/crash: fix incorrect number of bytes to copy to user space X-Git-Tag: baikal/mips/sdk6.1~5095^2~13^2~4 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=675228ddf44cd157e84657fdf0a10ed226ca7d24;p=kernel.git s390/crash: fix incorrect number of bytes to copy to user space 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 --- diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c index 117f13b3d1539..0efee5c49b1ec 100644 --- a/arch/s390/kernel/crash_dump.c +++ b/arch/s390/kernel/crash_dump.c @@ -199,7 +199,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; }