Skip to content

Commit

Permalink
hv: Check pcpu number in Hw platform detect
Browse files Browse the repository at this point in the history
if the physical number > CONFIG_MAX_PCPU_NUM,
will return error and panic.

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
  • Loading branch information
mingqiangchi authored and NanlinXie committed Oct 29, 2018
1 parent 298044d commit 672583a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hypervisor/arch/x86/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ static int hardware_detect_support(void)
return -ENODEV;
}

if (phys_cpu_num > CONFIG_MAX_PCPU_NUM) {
pr_fatal("%s, pcpu number(%d) is out of range\n", __func__, phys_cpu_num);
return -ENODEV;
}

ret = check_vmx_mmu_cap();
if (ret != 0) {
return ret;
Expand Down

0 comments on commit 672583a

Please sign in to comment.