linux-stable/arch/s390
Janis Schoetterl-Glausch b5d1274409 KVM: s390: Fix lockdep issue in vm memop
Issuing a memop on a protected vm does not make sense,
neither is the memory readable/writable, nor does it make sense to check
storage keys. This is why the ioctl will return -EINVAL when it detects
the vm to be protected. However, in order to ensure that the vm cannot
become protected during the memop, the kvm->lock would need to be taken
for the duration of the ioctl. This is also required because
kvm_s390_pv_is_protected asserts that the lock must be held.
Instead, don't try to prevent this. If user space enables secure
execution concurrently with a memop it must accecpt the possibility of
the memop failing.
Still check if the vm is currently protected, but without locking and
consider it a heuristic.

Fixes: ef11c9463a ("KVM: s390: Add vm IOCTL for key checked guest absolute memory access")
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20220322153204.2637400-1-scgl@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2022-05-02 19:45:03 +02:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390: remove invalid email address of Heiko Carstens 2022-02-06 23:31:29 +01:00
configs s390: enable CONFIG_HARDENED_USERCOPY in debug_defconfig 2022-04-12 11:56:08 +02:00
crypto s390: convert ".insn" encoding to instruction names 2022-03-10 15:58:17 +01:00
hypfs s390/extable: move EX_TABLE define to asm-extable.h 2022-03-08 00:33:00 +01:00
include s390: current_stack_pointer shouldn't be a function 2022-04-12 11:56:08 +02:00
kernel s390/kexec: silence -Warray-bounds warning 2022-04-07 12:36:54 +02:00
kvm KVM: s390: Fix lockdep issue in vm memop 2022-05-02 19:45:03 +02:00
lib s390: current_stack_pointer shouldn't be a function 2022-04-12 11:56:08 +02:00
mm s390: convert ".insn" encoding to instruction names 2022-03-10 15:58:17 +01:00
net s390: raise minimum supported machine generation to z10 2022-03-10 15:58:17 +01:00
pci s390/pci: rename get_zdev_by_bus() to zdev_from_bus() 2022-03-27 22:18:40 +02:00
purgatory s390: enable KCSAN 2021-07-30 17:09:23 +02:00
tools s390: raise minimum supported machine generation to z10 2022-03-10 15:58:17 +01:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig s390: allow to compile with z16 optimizations 2022-04-06 13:08:50 +02:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile s390: disable -Warray-bounds 2022-04-27 12:53:07 +02:00