lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 3 Jun 2024 19:56:45 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Babu Moger <babu.moger@....com>, kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: Fix Undefined Behavior Sanitizer(UBSAN) error

On Mon, Jun 3, 2024 at 7:54 PM Sean Christopherson <seanjc@...gle.com> wrote:
> > However, VM boots up fine without any issues and operational.

Yes, the caller uses kvm_handle_hva_range() as if it returned void.

> Ah, the "break" will only break out of the memslot loop, it won't break out of
> the address space loop.  Stupid SMM.
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index b312d0cbe60b..70f5a39f8302 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -651,7 +651,7 @@ static __always_inline kvm_mn_ret_t __kvm_handle_hva_range(struct kvm *kvm,
>                                         range->on_lock(kvm);
>
>                                 if (IS_KVM_NULL_FN(range->handler))
> -                                       break;
> +                                       goto mmu_unlock;
>                         }
>                         r.ret |= range->handler(kvm, &gfn_range);
>                 }
> @@ -660,6 +660,7 @@ static __always_inline kvm_mn_ret_t __kvm_handle_hva_range(struct kvm *kvm,
>         if (range->flush_on_ret && r.ret)
>                 kvm_flush_remote_tlbs(kvm);
>
> +mmu_unlock:
>         if (r.found_memslot)
>                 KVM_MMU_UNLOCK(kvm);

Yep. If you want to just reply with Signed-off-by I'll mix the
original commit message and your patch.

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ