Skip to content

Commit

Permalink
s390/crash: fix incorrect number of bytes to copy to user space
Browse files Browse the repository at this point in the history
[ Upstream commit f6749da ]

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: df9694c ("s390/dump: streamline oldmem copy functions")
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Alexander Gordeev authored and gregkh committed Aug 17, 2022
1 parent 2165fd2 commit f141577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f141577

Please sign in to comment.