Re: [PATCH] KVM: x86: Fix potential memory access error

2021-04-01 Thread Sean Christopherson
On Thu, Apr 01, 2021, Vitaly Kuznetsov wrote: > Sean Christopherson writes: > > > On Wed, Mar 31, 2021, Yang Li wrote: > >> Using __set_bit() to set a bit in an integer is not a good idea, since > >> the function expects an unsigned long as argument, which can be 64bit wide. > >> Coverity reports

Re: [PATCH] KVM: x86: Fix potential memory access error

2021-04-01 Thread Vitaly Kuznetsov
Sean Christopherson writes: > On Wed, Mar 31, 2021, Yang Li wrote: >> Using __set_bit() to set a bit in an integer is not a good idea, since >> the function expects an unsigned long as argument, which can be 64bit wide. >> Coverity reports this problem as >> >> High:Out-of-bounds access(INCOMPAT

Re: [PATCH] KVM: x86: Fix potential memory access error

2021-03-31 Thread Sean Christopherson
On Wed, Mar 31, 2021, Yang Li wrote: > Using __set_bit() to set a bit in an integer is not a good idea, since > the function expects an unsigned long as argument, which can be 64bit wide. > Coverity reports this problem as > > High:Out-of-bounds access(INCOMPATIBLE_CAST) > CWE119: Out-of-bounds ac

[PATCH] KVM: x86: Fix potential memory access error

2021-03-31 Thread Yang Li
Using __set_bit() to set a bit in an integer is not a good idea, since the function expects an unsigned long as argument, which can be 64bit wide. Coverity reports this problem as High:Out-of-bounds access(INCOMPATIBLE_CAST) CWE119: Out-of-bounds access to a scalar Pointer "&vcpu->arch.regs_avail"