From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: [PATCH 6/9] cpufreq: missing check of copy_from_guest() Date: Thu, 12 Sep 2013 13:15:27 +0100 Message-ID: <1378988130-24172-7-git-send-email-tim@xen.org> References: <1378988130-24172-1-git-send-email-tim@xen.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1378988130-24172-1-git-send-email-tim@xen.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Liu Jinsong , Jan Beulich List-Id: xen-devel@lists.xenproject.org Coverity CID 1055131 Coverity CID 1055132 Signed-off-by: Tim Deegan Cc: Jan Beulich Cc: Liu Jinsong --- xen/drivers/cpufreq/cpufreq.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c index 0de5d41..ab66884 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 ) -- 1.7.10.4