]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/intc: sifive_plic: fix out-of-bound access of source_priority array
authorJim Shu <jim.shu@sifive.com>
Sun, 27 Nov 2022 16:57:46 +0000 (16:57 +0000)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 6 Jan 2023 00:42:55 +0000 (10:42 +1000)
commitbb22d391121fc0de42a04d1ed99f602441ea70e1
treeda761478b364b76f2e1230a618cb500f505a2dde
parent592f0a9429b924bc7eec0aee60afa391f7ca96b2
hw/intc: sifive_plic: fix out-of-bound access of source_priority array

If the number of interrupt is not multiple of 32, PLIC will have
out-of-bound access to source_priority array. Compute the number of
interrupt in the last word to avoid this out-of-bound access of array.

Signed-off-by: Jim Shu <jim.shu@sifive.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
Message-Id: <20221127165753.30533-1-jim.shu@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/intc/sifive_plic.c