diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-01-12 16:25:15 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-01-20 15:29:34 +0100 |
commit | 04478197416e3a302e9ebc917ba1aa884ef9bfab (patch) | |
tree | 90e2b0646c5f1ee108fd1a8aace0176cf19afdf6 /samples/bpf/test_cls_bpf.sh | |
parent | Linux 4.10-rc3 (diff) | |
download | linux-04478197416e3a302e9ebc917ba1aa884ef9bfab.tar.xz linux-04478197416e3a302e9ebc917ba1aa884ef9bfab.zip |
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>
Diffstat (limited to 'samples/bpf/test_cls_bpf.sh')
0 files changed, 0 insertions, 0 deletions