Skip to content
Commit 2d2c6684 authored by Ben Dai's avatar Ben Dai Committed by Greg Kroah-Hartman
Browse files

genirq/timings: Prevent potential array overflow in __irq_timings_store()

commit b9cc7d8a upstream.

When the interrupt interval is greater than 2 ^ PREDICTION_BUFFER_SIZE *
PREDICTION_FACTOR us and less than 1s, the calculated index will be greater
than the length of irqs->ema_time[]. Check the calculated index before
using it to prevent array overflow.

Fixes: 23aa3b9a

 ("genirq/timings: Encapsulate storing function")
Signed-off-by: default avatarBen Dai <ben.dai@unisoc.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210425150903.25456-1-ben.dai9703@gmail.com
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 35575419
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment