Files
opensbi/lib/sbi
liutong f45b9433ed lib: sbi_pmu: fix integer overflow and zero-address in event_get_info
sbi_pmu_event_get_info() computes the shared memory size as
num_events * sizeof(struct sbi_pmu_event_info) before num_events is
validated. The product can wrap, in which case the domain check runs
against a truncated size while the loop below still iterates over the
original count, that is, past the region that was checked.

Check num_events against the largest value that cannot wrap, and reject
a zero address, both before the multiplication.

Fixes: e434584216 ("lib: sbi_pmu: Implement SBI PMU event info function")
Signed-off-by: liutong <liutong@iscas.ac.cn>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260910052629.3359493-3-liutong@iscas.ac.cn
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-10-26 10:28:28 +05:30
..
2020-03-11 15:29:45 +05:30
2026-09-16 09:48:30 +05:30
2026-09-16 09:48:30 +05:30
2026-09-16 09:48:30 +05:30
2026-06-12 11:58:35 +05:30