Re: [PATCH v2 8/9] KVM: s390: Fix potential tiny kernel stack leak

"Christoph Schlameuss" <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.kvm,org.kernel.vger.linux-s390
Message-ID <[email protected]>
On Wed Aug 12, 2026 at 12:44 PM CEST, Claudio Imbrenda wrote:
> In some circumstances, one bit of kernel stack could have been leaked
> from dat_cond_set_storage_key().
>
> Fix by clearing prev before use.
>
> Fixes: 8e03e8316eb2 ("KVM: s390: KVM page table management functions: storage keys")
> Signed-off-by: Claudio Imbrenda <[email protected]>
> Reviewed-by: Christian Borntraeger <[email protected]>

Reviewed-by: Christoph Schlameuss <[email protected]>

> ---
>  arch/s390/kvm/dat.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/s390/kvm/dat.c b/arch/s390/kvm/dat.c
> index f4dd6f783417..f2ea013cb33e 100644
> --- a/arch/s390/kvm/dat.c
> +++ b/arch/s390/kvm/dat.c
> @@ -737,6 +737,7 @@ int dat_cond_set_storage_key(struct kvm_s390_mmu_cache *mmc, union asce asce, gf
>  	pgste.fp = skey.fp;
>  	pgste.gc = skey.c;
>  	pgste.gr = skey.r;
> +	prev.skey = 0;
>  
>  	if (!ptep->h.i) {
>  		rc = page_cond_set_storage_key(pte_origin(*ptep), skey, &prev, nq, mr, mc);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.