Skip to content

Commit 785b3f6

Browse files
ahajdatursulin
authored andcommitted
drm/i915/perf: add sentinel to xehp_oa_b_counters
Arrays passed to reg_in_range_table should end with empty record. The patch solves KASAN detected bug with signature: BUG: KASAN: global-out-of-bounds in xehp_is_valid_b_counter_addr+0x2c7/0x350 [i915] Read of size 4 at addr ffffffffa1555d90 by task perf/1518 CPU: 4 PID: 1518 Comm: perf Tainted: G U 6.4.0-kasan_438-g3303d06107f3+ #1 Hardware name: Intel Corporation Meteor Lake Client Platform/MTL-P DDR5 SODIMM SBS RVP, BIOS MTLPFWI1.R00.3223.D80.2305311348 05/31/2023 Call Trace: <TASK> ... xehp_is_valid_b_counter_addr+0x2c7/0x350 [i915] Fixes: 0fa9349 ("drm/i915/perf: complete programming whitelisting for XEHPSDV") Signed-off-by: Andrzej Hajda <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 2f42c5a) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent fdf0eaf commit 785b3f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/i915/i915_perf.c

+1
Original file line numberDiff line numberDiff line change
@@ -4431,6 +4431,7 @@ static const struct i915_range mtl_oam_b_counters[] = {
44314431
static const struct i915_range xehp_oa_b_counters[] = {
44324432
{ .start = 0xdc48, .end = 0xdc48 }, /* OAA_ENABLE_REG */
44334433
{ .start = 0xdd00, .end = 0xdd48 }, /* OAG_LCE0_0 - OAA_LENABLE_REG */
4434+
{}
44344435
};
44354436

44364437
static const struct i915_range gen7_oa_mux_regs[] = {

0 commit comments

Comments
 (0)