s390/maccess: fix semantics of memcpy_real() and its callers
authorAlexander Gordeev <agordeev@linux.ibm.com>
Sat, 29 Jan 2022 08:24:50 +0000 (09:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:09 +0000 (14:24 +0200)
commit2165fd2bae8ad2cbf2d79b80d13f6e896eeaefe6
treeb8666f70a3f948f85905306ca4934373b70497e8
parentceea1bc1531000db1c619fc3f4f741c356dd54dc
s390/maccess: fix semantics of memcpy_real() and its callers

[ Upstream commit 303fd988ed644c7daa260410f3ac99266573557d ]

There is a confusion with regard to the source address of
memcpy_real() and calling functions. While the declared
type for a source assumes a virtual address, in fact it
always called with physical address of the source.

This confusion led to bugs in copy_oldmem_kernel() and
copy_oldmem_user() functions, where __pa() macro applied
mistakenly to physical addresses. It does not lead to a
real issue, since virtual and physical addresses are
currently the same.

Fix both the bugs and memcpy_real() prototype by making
type of source address consistent to the function name
and the way it actually used.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/include/asm/os_info.h
arch/s390/include/asm/processor.h
arch/s390/include/asm/uaccess.h
arch/s390/kernel/crash_dump.c
arch/s390/kernel/os_info.c
arch/s390/kernel/smp.c
arch/s390/mm/maccess.c
drivers/s390/char/zcore.c