]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2a973d4389c707a903249c6bdc051caef6b1ea90
treeb8666f70a3f948f85905306ca4934373b70497e8
parenta0a96a0ab4e1f1156b80a9427d6adfc074d75529
s390/maccess: fix semantics of memcpy_real() and its callers

[ Upstream commit 7c0eeaf4382cc5179dc06a4a9f4db751aa3fba50 ]

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