summaryrefslogtreecommitdiff
path: root/arch/s390
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2022-07-15 13:59:33 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-17 15:24:10 +0300
commitf1415771f6a1e2d63265bf8399946d2ead837171 (patch)
tree0fbe544230f66f2a3fbb65998fdb5f4ad5cb14b2 /arch/s390
parent2165fd2bae8ad2cbf2d79b80d13f6e896eeaefe6 (diff)
downloadlinux-f1415771f6a1e2d63265bf8399946d2ead837171.tar.xz
s390/crash: fix incorrect number of bytes to copy to user space
[ Upstream commit f6749da17a34eb08c9665f072ce7c812ff68aad2 ] 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 <willy@infradead.org> Fixes: df9694c7975f ("s390/dump: streamline oldmem copy functions") Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/crash_dump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
index 199f136d1644..f17ad2daab07 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;
}