From: Tim Deegan Date: Thu, 12 Sep 2013 11:36:04 +0000 (+0100) Subject: cpufreq: missing check of copy_from_guest() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6376 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=803f9a6cdfeda64beee908576de0ad02d6b0c480;p=xen.git cpufreq: missing check of copy_from_guest() Coverity CID 1055131 Coverity CID 1055132 Signed-off-by: Tim Deegan Reviewed-by: Andrew Cooper Acked-by: Jan Beulich --- diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c index 0de5d41d44..ab66884797 100644 --- a/xen/drivers/cpufreq/cpufreq.c +++ b/xen/drivers/cpufreq/cpufreq.c @@ -471,8 +471,12 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_in ret = -ENOMEM; goto out; } - copy_from_guest(pxpt->states, dom0_px_info->states, - dom0_px_info->state_count); + if ( copy_from_guest(pxpt->states, dom0_px_info->states, + dom0_px_info->state_count) ) + { + ret = -EFAULT; + goto out; + } pxpt->state_count = dom0_px_info->state_count; if ( cpufreq_verbose )