linux-hardened/arch/s390
Heiko Carstens 631aebfee8 KVM: s390: sthyi: remove invalid guest write access
handle_sthyi() always writes to guest memory if the sthyi function
code is zero in order to fault in the page that later is written to.

However a function code of zero does not necessarily mean that a write
to guest memory happens: if the KVM host is running as a second level
guest under z/VM 6.2 the sthyi instruction is indicated to be
available to the KVM host, however if the instruction is executed it
will always return with a return code that indicates "unsupported
function code".

In such a case handle_sthyi() must not write to guest memory. This
means that the prior write access to fault in the guest page may
result in invalid guest exceptions, and/or invalid data modification.

In order to be architecture compliant simply remove the write_guest()
call.

Given that the guest assumed a write access anyway, this fix does not
qualify for -stable. This just makes sure the sthyi handler is
architecture compliant.

Fixes: 95ca2cb579 ("KVM: s390: Add sthyi emulation")
Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-08-29 15:15:56 +02:00
..
appldata
boot
configs
crypto
hypfs
include KVM: s390: Multiple Epoch Facility support 2017-08-29 15:15:54 +02:00
kernel s390/mm: tag normal pages vs pages used in page tables 2017-07-25 06:55:28 +02:00
kvm KVM: s390: sthyi: remove invalid guest write access 2017-08-29 15:15:56 +02:00
lib
mm s390/mm,kvm: use nodat PGSTE tag to optimize TLB flushing 2017-07-25 06:55:35 +02:00
net
numa
oprofile
pci
tools KVM: s390: Multiple Epoch Facility support 2017-08-29 15:15:54 +02:00
defconfig
Kbuild
Kconfig
Kconfig.debug
Makefile