Commit 3b909544 authored by Alexander Egorenkov's avatar Alexander Egorenkov Committed by Heiko Carstens

s390/dump: fix copying to user-space of swapped kdump oldmem

This commit fixes a bug introduced by commit e9e7870f ("s390/dump:
introduce boot data 'oldmem_data'").
OLDMEM_BASE was mistakenly replaced by oldmem_data.size instead of
oldmem_data.start.

This bug caused the following error during kdump:
kdump.sh[878]: No program header covering vaddr 0x3434f5245found kexec bug?

Fixes: e9e7870f ("s390/dump: introduce boot data 'oldmem_data'")
Cc: stable@vger.kernel.org # 5.15+
Signed-off-by: default avatarAlexander Egorenkov <egorenar@linux.ibm.com>
Reviewed-by: default avatarMarc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 6c122360
...@@ -191,8 +191,8 @@ static int copy_oldmem_user(void __user *dst, void *src, size_t count) ...@@ -191,8 +191,8 @@ static int copy_oldmem_user(void __user *dst, void *src, size_t count)
return rc; return rc;
} else { } else {
/* Check for swapped kdump oldmem areas */ /* Check for swapped kdump oldmem areas */
if (oldmem_data.start && from - oldmem_data.size < oldmem_data.size) { if (oldmem_data.start && from - oldmem_data.start < oldmem_data.size) {
from -= oldmem_data.size; from -= oldmem_data.start;
len = min(count, oldmem_data.size - from); len = min(count, oldmem_data.size - from);
} else if (oldmem_data.start && from < oldmem_data.size) { } else if (oldmem_data.start && from < oldmem_data.size) {
len = min(count, oldmem_data.size - from); len = min(count, oldmem_data.size - from);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment