linux/arch/s390/kvm
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
..
diag.c KVM: s390: provide logging for diagnose 0x500 2016-06-10 12:07:26 +02:00
gaccess.c PPC: 2017-07-06 18:38:31 -07:00
gaccess.h s390: rename psw_bits enums 2017-06-12 16:26:02 +02:00
guestdbg.c s390: rename psw_bits enums 2017-06-12 16:26:02 +02:00
intercept.c KVM: s390: Support keyless subset guest mode 2017-04-21 11:08:11 +02:00
interrupt.c PPC: 2017-07-06 18:38:31 -07:00
irq.h KVM: s390: irq routing for adapter interrupts. 2014-03-21 13:43:00 +01:00
Kconfig KVM: halt_polling: provide a way to qualify wakeups during poll 2016-05-13 17:29:23 +02:00
kvm-s390.c KVM: s390: Multiple Epoch Facility support 2017-08-29 15:15:54 +02:00
kvm-s390.h KVM: s390: Multiple Epoch Facility support 2017-08-29 15:15:54 +02:00
Makefile KVM: s390: vsie: initial support for nested virtualization 2016-06-21 09:43:33 +02:00
priv.c PPC: 2017-07-06 18:38:31 -07:00
sigp.c KVM: s390: Support Configuration z/Architecture Mode 2017-08-28 16:25:13 +02:00
sthyi.c KVM: s390: sthyi: remove invalid guest write access 2017-08-29 15:15:56 +02:00
trace-s390.h KVM: s390: introduce adapter interrupt inject function 2017-04-06 13:15:37 +02:00
trace.h KVM: s390: trace and count all skey intercepts 2016-06-10 12:07:31 +02:00
vsie.c KVM: s390: Multiple Epoch Facility support 2017-08-29 15:15:54 +02:00