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] [day] [month] [year] [list]
Message-ID: <5bf03dc1-c5b1-8264-6361-e85c523a2fa4@redhat.com>
Date:   Mon, 4 May 2020 17:59:13 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Sean Christopherson <sean.j.christopherson@...el.com>
Cc:     Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        clang-built-linux@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: nVMX: Replace a BUG_ON(1) with BUG() to squash clang
 warning

On 04/05/20 17:35, Sean Christopherson wrote:
> Use BUG() in the impossible-to-hit default case when switching on the
> scope of INVEPT to squash a warning with clang 11 due to clang treating
> the BUG_ON() as conditional.
> 
>   >> arch/x86/kvm/vmx/nested.c:5246:3: warning: variable 'roots_to_free'
>      is used uninitialized whenever 'if' condition is false
>      [-Wsometimes-uninitialized]
>                    BUG_ON(1);
> 
> Reported-by: kbuild test robot <lkp@...el.com>
> Fixes: ce8fe7b77bd8 ("KVM: nVMX: Free only the affected contexts when emulating INVEPT")
> Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
> ---
>  arch/x86/kvm/vmx/nested.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 2c36f3f53108..669445136144 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5249,7 +5249,7 @@ static int handle_invept(struct kvm_vcpu *vcpu)
>  		roots_to_free = KVM_MMU_ROOTS_ALL;
>  		break;
>  	default:
> -		BUG_ON(1);
> +		BUG();
>  		break;
>  	}
>  
> 

Queued, thanks.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ