[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] VMX: make vmx_read_guest_msr() cope with callers not checking its return value



>>> On 15.08.18 at 13:39, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 15/08/18 12:34, Jan Beulich wrote:
>> It took till the 4.5 backports of the L1TF prereqs that gcc 8.2 finally
>> noticed that the vPMU callers, not checking the function's return value,
>> may consume uninitialized data. Guard against this by storing zero on
>> the error path.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> vPMU really is the gift which keeps on giving...
> 
>>
>> --- a/xen/include/asm-x86/hvm/vmx/vmcs.h
>> +++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
>> @@ -586,7 +586,10 @@ static inline int vmx_read_guest_msr(con
>>      const struct vmx_msr_entry *ent = vmx_find_msr(v, msr, VMX_MSR_GUEST);
>>  
>>      if ( !ent )
>> +    {
>> +        *val = 0;
>>          return -ESRCH;
>> +    }
>>  
>>      *val = ent->data;
>>  
> 
> You want a similar adjustment in vmx_read_guest_loadonly_msr()
> immediately below, which I believe is only applicable to staging atm.

Oh, indeed - coming from 4.5 I didn't pay enough attention here.

> With that, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Thanks, Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.