 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 3/9] x86/vvmx: Extract operand reading logic into operand_read()
 >>> On 26.10.17 at 19:03, <euan.harris@xxxxxxxxxx> wrote:
> +static int operand_read(void *buf, struct vmx_inst_op *op,
> +                        struct cpu_user_regs *regs, unsigned int bytes)
const (twice)
> +{
> +    if ( op->type == VMX_INST_MEMREG_TYPE_REG )
> +    {
> +        switch ( bytes )
> +        {
> +        case 4:
> +            *(uint32_t *)buf = reg_read(regs, op->reg_idx);
Looking at patch 7, you leave the upper half of 64-bit variables
uninitialized here as well as in the memory case further down
when passing in a smaller value for "bytes". A decent static
analyzer should flag this, and I think things also wouldn't work
right in a few cases.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |