Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/gt: Delete sysfs entries for engines on driver unload
@ 2024-08-01 15:40 Krzysztof Niemiec
  2024-08-01 16:36 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Krzysztof Niemiec @ 2024-08-01 15:40 UTC (permalink / raw)
  To: intel-gfx
  Cc: dri-devel, Chris Wilson, Nitin Gote, Andi Shyti, Nirmoy Das,
	Janusz Krzysztofik, Krzysztof Niemiec

While the sysfs entries for engines are added in intel_engines_init()
during driver load, the corresponding function intel_engines_release()
does not correctly get rid of them. This can lead to a UAF if, after
failed initialization (for example when gt is set wedged on init), we
try to access the engines.

Empty the engines llist in intel_engines_release().

Suggested-by: Chris Wilson <chris.p.wilson@linux.intel.com>
Signed-off-by: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 3b740ca25000..4d30a86016f2 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -693,6 +693,8 @@ void intel_engines_release(struct intel_gt *gt)
 
 		memset(&engine->reset, 0, sizeof(engine->reset));
 	}
+
+	llist_del_all(&gt->i915->uabi_engines_llist);
 }
 
 void intel_engine_free_request_pool(struct intel_engine_cs *engine)
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-05 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01 15:40 [PATCH] drm/i915/gt: Delete sysfs entries for engines on driver unload Krzysztof Niemiec
2024-08-01 16:36 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-08-02  8:15 ` [PATCH] " Andi Shyti
2024-08-02  8:49 ` ✗ Fi.CI.IGT: failure for " Patchwork
2024-08-05 15:46 ` [PATCH] " Krzysztof Niemiec
2024-08-05 22:30   ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox