drm/i915: fix typo causing bad memory access in ring init
Subsystems (2)
Dave Airlie
maintainerPATCH 1/1 drm/i915: fix typo causing bad memory access in ring init
From: Dave Airlie <[email protected]>
This is validating from the wrong index.
testing with KASAN found it.
--- drivers/gpu/drm/i915/i915_cmd_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_cmd_parser.c +1 -1
@@ -534,7 +534,7 @@ static bool validate_cmds_sorted(struct intel_engine_cs *ring,for (j =0 ; j < table->count; j++) {const struct drm_i915_cmd_descriptor *desc = - &table->table[i]; + &table->table[j];u32 curr = desc->cmd.value & desc->cmd.mask;if (curr < previous) {
Signature · 6 lines
2.4.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 17 lines · Dave Airlie
From: Dave Airlie <[email protected]>
This is validating from the wrong index.
testing with KASAN found it.
Reported-by Dave Jones <[email protected]>Signed-off-by Dave Airlie <[email protected]>--- drivers/gpu/drm/i915/i915_cmd_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/i915_cmd_parser.c +0
-0
drivers/gpu/drm/i915/i915_cmd_parser.c static bool validate_cmds_sorted(struct intel_engine_cs *ring, · line 538
Quoted 6 lines
drivers/gpu/drm/i915/i915_cmd_parser.c +1
-1@@ -534,7 +534,7 @@ static bool validate_cmds_sorted(struct intel_engine_cs *ring,for (j =0 ; j < table->count; j++) {const struct drm_i915_cmd_descriptor *desc = - &table->table[i]; + &table->table[j];u32 curr = desc->cmd.value & desc->cmd.mask;
Which uncovered another problem that the tables weren't sorted and triggered a nasty BUG().
Daniel should have already sent the pair of fixes onwards. -Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 28 lines · Chris Wilson
Quoted 17 lines · Dave Airlie
From: Dave Airlie <[email protected]>
This is validating from the wrong index.
testing with KASAN found it.
Reported-by Dave Jones <[email protected]>Signed-off-by Dave Airlie <[email protected]>--- drivers/gpu/drm/i915/i915_cmd_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/i915_cmd_parser.c +0
-0drivers/gpu/drm/i915/i915_cmd_parser.c static bool validate_cmds_sorted(struct intel_engine_cs *ring, · line 538
Quoted 6 lines
drivers/gpu/drm/i915/i915_cmd_parser.c +1
-1@@ -534,7 +534,7 @@ static bool validate_cmds_sorted(struct intel_engine_cs *ring,for (j =0 ; j < table->count; j++) {const struct drm_i915_cmd_descriptor *desc = - &table->table[i]; + &table->table[j];u32 curr = desc->cmd.value & desc->cmd.mask;Which uncovered another problem that the tables weren't sorted and triggered a nasty
BUG().
Quoted 1 line
Daniel should have already sent the pair of fixes onwards.
Yeah if you want this fixed asap you need 9f58582c7ad64f025e7f and 8453580cb8834dedffda from next for other it'll BUG. -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx