mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-04 09:50:54 +00:00
hv: fix potential buffer overflow in vpic_set_pinstate()
Input 'pin' should be less than 'NR_VPIC_PINS_TOTAL' Tracked-On: #1479 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
268a9f1453
commit
bd042352cd
@ -405,6 +405,10 @@ static void vpic_set_pinstate(struct acrn_vpic *vpic, uint8_t pin,
|
|||||||
uint8_t old_lvl;
|
uint8_t old_lvl;
|
||||||
bool lvl_trigger;
|
bool lvl_trigger;
|
||||||
|
|
||||||
|
if (pin >= NR_VPIC_PINS_TOTAL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
i8259 = &vpic->i8259[pin >> 3U];
|
i8259 = &vpic->i8259[pin >> 3U];
|
||||||
old_lvl = i8259->pin_state[pin & 0x7U];
|
old_lvl = i8259->pin_state[pin & 0x7U];
|
||||||
if (level) {
|
if (level) {
|
||||||
|
Loading…
Reference in New Issue
Block a user