linux-sg2042/arch/s390/kvm
Christian Borntraeger 0447819741 KVM: s390: do not expose random data via facility bitmap
kvm_s390_get_machine() populates the facility bitmap by copying bytes
from the host results that are stored in a 256 byte array in the prefix
page. The KVM code does use the size of the target buffer (2k), thus
copying and exposing unrelated kernel memory (mostly machine check
related logout data).

Let's use the size of the source buffer instead.  This is ok, as the
target buffer will always be greater or equal than the source buffer as
the KVM internal buffers (and thus S390_ARCH_FAC_LIST_SIZE_BYTE) cover
the maximum possible size that is allowed by STFLE, which is 256
doublewords. All structures are zero allocated so we can leave bytes
256-2047 unchanged.

Add a similar fix for kvm_arch_init_vm().

Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
[found with smatch]
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
CC: stable@vger.kernel.org
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-01-20 15:29:34 +01:00
..
Kconfig KVM: halt_polling: provide a way to qualify wakeups during poll 2016-05-13 17:29:23 +02:00
Makefile KVM: s390: vsie: initial support for nested virtualization 2016-06-21 09:43:33 +02:00
diag.c KVM: s390: provide logging for diagnose 0x500 2016-06-10 12:07:26 +02:00
gaccess.c KVM: s390: gaccess: simplify translation exception handling 2016-09-08 09:07:53 +02:00
gaccess.h s390/mm: take ipte_lock during shadow faults 2016-06-20 09:54:40 +02:00
guestdbg.c KVM: s390: Use memdup_user() rather than duplicating code 2016-09-08 13:40:55 +02:00
intercept.c KVM: s390: reject invalid modes for runtime instrumentation 2016-10-20 20:06:12 +02:00
interrupt.c ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
irq.h KVM: s390: irq routing for adapter interrupts. 2014-03-21 13:43:00 +01:00
kvm-s390.c KVM: s390: do not expose random data via facility bitmap 2017-01-20 15:29:34 +01:00
kvm-s390.h KVM: s390: allow 255 VCPUs when sca entries aren't used 2016-09-08 13:40:53 +02:00
priv.c KVM: s390: lazy enable RI 2016-09-08 13:40:39 +02:00
sigp.c KVM: s390: don't use CPUSTAT_WAIT to detect if a VCPU is idle 2016-06-21 09:43:45 +02:00
sthyi.c KVM: s390: Fix STHYI buffer alignment for diag224 2016-10-26 13:46:44 +02:00
trace-s390.h KVM: s390: obey kptr_restrict in traces 2015-12-15 17:06:32 +01:00
trace.h KVM: s390: trace and count all skey intercepts 2016-06-10 12:07:31 +02:00
vsie.c KVM: s390: vsie: fix riccbd 2016-09-05 13:48:50 +02:00