Skip to content

Commit

Permalink
s390/dump: fix copying to user-space of swapped kdump oldmem
Browse files Browse the repository at this point in the history
This commit fixes a bug introduced by commit e9e7870 ("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: e9e7870 ("s390/dump: introduce boot data 'oldmem_data'")
Cc: [email protected] # 5.15+
Signed-off-by: Alexander Egorenkov <[email protected]>
Reviewed-by: Marc Hartmayer <[email protected]>
Reviewed-by: Heiko Carstens <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
  • Loading branch information
eaibmz authored and hcahca committed Nov 18, 2021
1 parent 6c12236 commit 3b90954
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/s390/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ static int copy_oldmem_user(void __user *dst, void *src, size_t count)
return rc;
} else {
/* Check for swapped kdump oldmem areas */
if (oldmem_data.start && from - oldmem_data.size < oldmem_data.size) {
from -= oldmem_data.size;
if (oldmem_data.start && from - oldmem_data.start < oldmem_data.size) {
from -= oldmem_data.start;
len = min(count, oldmem_data.size - from);
} else if (oldmem_data.start && from < oldmem_data.size) {
len = min(count, oldmem_data.size - from);
Expand Down

0 comments on commit 3b90954

Please sign in to comment.