mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 00:38:28 +00:00
HV: Fixes index out of bounds for addressing irq.
NR_MAX_IRQS is defined as 272 and IRQ_INVALID as 273 which implies that 272 is a valid irq number. In this case, an illegal access can occur at run time when irq_desc_array[] or irq_count[] is accessed with index 272. This fix stops the illegal access by renaming NR_MAX_IRQS to NR_IRQS and then places proper conditions for range checks. If the index is >= NR_IRQS, then index is invalid otherwise its considered valid for accessing irq arrays. IRQ_INVALID definition is also changed to 0xffffffffU to indicate maximum unsigned value. Signed-off-by: Madeeha Javed <madeeha_javed@mentor.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
struct per_cpu_region {
|
||||
uint64_t *sbuf[ACRN_SBUF_ID_MAX];
|
||||
uint64_t irq_count[NR_MAX_IRQS];
|
||||
uint64_t irq_count[NR_IRQS];
|
||||
uint64_t vmexit_cnt[64];
|
||||
uint64_t vmexit_time[64];
|
||||
uint64_t softirq_pending;
|
||||
|
Reference in New Issue
Block a user