mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 04:33:55 +00:00
hv: fix possible buffer overflow in 'vcpu_set_eoi_exit()'
'vector' should be no greater than 0xff,else 'eoi_exit_bitmap[]' will overflow. Tracked-On: #1252 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
88eeae3f1f
commit
ee066a7f1c
@ -145,7 +145,7 @@ void vcpu_set_eoi_exit(struct acrn_vcpu *vcpu, uint32_t vector)
|
||||
pr_dbg("%s", __func__);
|
||||
|
||||
if (bitmap_test_and_set_nolock((uint16_t)(vector & 0x3fU),
|
||||
&(vcpu->arch.eoi_exit_bitmap[vector >> 6U]))) {
|
||||
&(vcpu->arch.eoi_exit_bitmap[(vector & 0xffU) >> 6U]))) {
|
||||
pr_warn("Duplicated vector %u vcpu%u", vector, vcpu->vcpu_id);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user