]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: s390: Fix leaking of PGM_ADDRESSING to userspace
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 3 Aug 2026 12:40:33 +0000 (14:40 +0200)
committerClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 3 Aug 2026 14:51:33 +0000 (16:51 +0200)
commitd699986f11bf854bddecd6b1bfdf53e05ef945d6
treedf3f891c5c76c6016473a9f5ee2b7ea8586ea039
parentd301ade41831e746783bdb697fae3afba47841ba
KVM: s390: Fix leaking of PGM_ADDRESSING to userspace

If kvm_s390_set_cmma_bits() is asked to set CMMA values outside of a
memslot, PGM_ADDRESSING (5) is returned, instead of a negative error
value.

Same issue with kvm_s390_{g,s}et_skeys(), kvm_s390_keyop(), and
dat_reset_reference_bit().

Fix by returning -EFAULT whenever the return value would be > 0, which
is consistent with the behaviour before the gmap rewrite.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-7-imbrenda@linux.ibm.com>
arch/s390/kvm/dat.c
arch/s390/kvm/dat.h
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/priv.c