Message ID | 162860287930.395.16257613336849312790.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers | show |
Series | [tip:,irq/urgent] genirq/timings: Prevent potential array overflow in __irq_timings_store() | expand |
diff --git a/kernel/irq/timings.c b/kernel/irq/timings.c index d309d6f..4d2a702 100644 --- a/kernel/irq/timings.c +++ b/kernel/irq/timings.c @@ -453,6 +453,11 @@ static __always_inline void __irq_timings_store(int irq, struct irqt_stat *irqs, */ index = irq_timings_interval_index(interval); + if (index > PREDICTION_BUFFER_SIZE - 1) { + irqs->count = 0; + return; + } + /* * Store the index as an element of the pattern in another * circular array.