Files
opensbi/lib/sbi
Himanshu Chauhan ed70256dd2 lib: sbi: fix trigger read/update/install range check
sbi_dbtr_read_trig() rejects ranges ending exactly at total_trigs
because it treats trig_idx_base + trig_count == total_trigs as
out of range. This breaks the corner case where supervisor
software reads the last trigger by asking for base total_trigs - 1
and count 1.

Validate the base first, then compare trig_count against
total_trigs - trig_idx_base. This permits exact-end ranges and avoids
relying on unsigned addition that could overflow for a bad count.

On similar lines, the trig_count parameter of sbi_dbtr_install_trig()
and sbi_dbtr_update_trig() can be equal to total_trigs.

Fixes: a14e4d24a1 ("lib: sbi: dbtr: fix integer overflow in read_trig bounds check")
Fixes: 97f234f15c ("lib: sbi: Introduce the SBI debug triggers extension support")
Signed-off-by: Himanshu Chauhan <himanshu.chauhan@oss.qualcomm.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20261107060325.1117887-1-himanshu.chauhan@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-11-10 13:59:44 +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