summaryrefslogtreecommitdiff
path: root/arch/s390/kvm/dat.h
diff options
context:
space:
mode:
authorClaudio Imbrenda <imbrenda@linux.ibm.com>2026-08-03 14:40:33 +0200
committerClaudio Imbrenda <imbrenda@linux.ibm.com>2026-08-03 16:51:33 +0200
commitd699986f11bf854bddecd6b1bfdf53e05ef945d6 (patch)
treedf3f891c5c76c6016473a9f5ee2b7ea8586ea039 /arch/s390/kvm/dat.h
parentd301ade41831e746783bdb697fae3afba47841ba (diff)
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>
Diffstat (limited to 'arch/s390/kvm/dat.h')
-rw-r--r--arch/s390/kvm/dat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/kvm/dat.h b/arch/s390/kvm/dat.h
index fad605305e05..141ee7b9f019 100644
--- a/arch/s390/kvm/dat.h
+++ b/arch/s390/kvm/dat.h
@@ -537,7 +537,7 @@ int dat_set_storage_key(struct kvm_s390_mmu_cache *mc, union asce asce, gfn_t gf
union skey skey, bool nq);
int dat_cond_set_storage_key(struct kvm_s390_mmu_cache *mmc, union asce asce, gfn_t gfn,
union skey skey, union skey *oldkey, bool nq, bool mr, bool mc);
-int dat_reset_reference_bit(union asce asce, gfn_t gfn);
+int dat_reset_reference_bit(union asce asce, gfn_t gfn, union skey *skey);
long dat_reset_skeys(union asce asce, gfn_t start);
unsigned long dat_get_ptval(struct page_table *table, struct ptval_param param);