>>> On 16.02.15 at 23:26, <boris.ostrov...@oracle.com> wrote: > +long do_xenpmu_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) > arg) > +{ > + int ret; > + struct xen_pmu_params pmu_params; > + > + if ( vpmu_disabled ) > + return -EINVAL; > + > + ret = xsm_pmu_op(XSM_OTHER, current->domain, op); > + if ( ret ) > + return ret; > + > + /* Check major version when parameters are specified */ > + switch ( op ) > + { > + case XENPMU_mode_set: > + case XENPMU_feature_set: > + if ( copy_from_guest(&pmu_params, arg, 1) ) > + return -EFAULT; > + > + if ( pmu_params.version.maj != XENPMU_VER_MAJ ) > + return -EINVAL; > + } > + > + switch ( op ) > + { > + case XENPMU_mode_set: > + { > + unsigned int old_mode; > + static DEFINE_SPINLOCK(xenpmu_mode_lock); > + > + if ( pmu_params.val & ~(XENPMU_MODE_SELF | XENPMU_MODE_HV) )
I btw also highly doubt that all compiler versions can properly track the pmu_params is not used uninitialized here. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel