31 lines
993 B
Diff
31 lines
993 B
Diff
|
# Commit 803f9a6cdfeda64beee908576de0ad02d6b0c480
|
||
|
# Date 2013-09-12 17:47:08 +0100
|
||
|
# Author Tim Deegan <tim@xen.org>
|
||
|
# Committer Tim Deegan <tim@xen.org>
|
||
|
cpufreq: missing check of copy_from_guest()
|
||
|
|
||
|
Coverity CID 1055131
|
||
|
Coverity CID 1055132
|
||
|
|
||
|
Signed-off-by: Tim Deegan <tim@xen.org>
|
||
|
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
|
||
|
Acked-by: Jan Beulich <jbeulich@suse.com>
|
||
|
|
||
|
--- a/xen/drivers/cpufreq/cpufreq.c
|
||
|
+++ b/xen/drivers/cpufreq/cpufreq.c
|
||
|
@@ -471,8 +471,12 @@ int set_px_pminfo(uint32_t acpi_id, stru
|
||
|
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 )
|