Re: [PATCH 2/3] KVM: s390: zero initialize irq for inject_pfault_token

Matthew Rosato <[email protected]>
Newsgroups org.kernel.vger.linux-s390,org.kernel.vger.kvm,org.kernel.vger.stable
Message-ID <[email protected]>
On 8/4/26 8:06 AM, Christian Borntraeger wrote:
> __kvm_inject_pfault_token() only sets .type and .u.ext.ext_params2 of
> the on-stack struct kvm_s390_irq but the full ext substructure is copied
> into the cpu local variable on inject. ext_params and pad contain stale
> stack values.
> 
> Interrupt delivery only uses ext_params2, so nothing leaks, but a host
> user can use the migration ioctls to get to the data.
> 
> Fix by zero-initializing the irq struct.
> 
> Fixes: 383d0b050106 ("KVM: s390: handle pending local interrupts via bitmap")
> Cc: [email protected]
> Signed-off-by: Christian Borntraeger <[email protected]>

Reviewed-by: Matthew Rosato <[email protected]>

> ---
>  arch/s390/kvm/kvm-s390.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 4a38de3d6758..447e6a61f886 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -4474,7 +4474,7 @@ static void __kvm_inject_pfault_token(struct kvm_vcpu *vcpu, bool start_token,
>  				     unsigned long token)
>  {
>  	struct kvm_s390_interrupt inti;
> -	struct kvm_s390_irq irq;
> +	struct kvm_s390_irq irq = {};
>  	struct kvm_s390_interrupt_info *inti_mem = NULL;
>  	int ret = 0;
>
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.