summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2022-07-15 12:59:33 +0200
committerAlexander Gordeev <agordeev@linux.ibm.com>2022-07-20 17:21:41 +0200
commitf6749da17a34eb08c9665f072ce7c812ff68aad2 (patch)
treec879fc3814c2090141e81bfc8499211df02479b0 /arch/s390
parents390/crash: remove redundant panic() on save area allocation failure (diff)
downloadlinux-f6749da17a34eb08c9665f072ce7c812ff68aad2.tar.xz
linux-f6749da17a34eb08c9665f072ce7c812ff68aad2.zip
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 <willy@infradead.org> Fixes: df9694c7975f ("s390/dump: streamline oldmem copy functions") Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
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 117f13b3d153..0efee5c49b1e 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;
}