提交 3a34a881 编写于 作者: R Roel Kluin 提交者: Avi Kivity

KVM: fix EFER read buffer overflow

Check whether index is within bounds before grabbing the element.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 1f3ee616
......@@ -571,12 +571,15 @@ static void reload_tss(void)
static void load_transition_efer(struct vcpu_vmx *vmx)
{
int efer_offset = vmx->msr_offset_efer;
u64 host_efer = vmx->host_msrs[efer_offset].data;
u64 guest_efer = vmx->guest_msrs[efer_offset].data;
u64 host_efer;
u64 guest_efer;
u64 ignore_bits;
if (efer_offset < 0)
return;
host_efer = vmx->host_msrs[efer_offset].data;
guest_efer = vmx->guest_msrs[efer_offset].data;
/*
* NX is emulated; LMA and LME handled by hardware; SCE meaninless
* outside long mode
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册