OSDN Git Service

drm/i915: Fix a potential UAF at device unload
authorNirmoy Das <nirmoy.das@intel.com>
Fri, 23 Sep 2022 07:35:14 +0000 (09:35 +0200)
committerAndi Shyti <andi.shyti@linux.intel.com>
Thu, 29 Sep 2022 11:29:38 +0000 (13:29 +0200)
commitc50cec9bab620927445e9c7c050a8fae536557b8
treee4a2a1cffc8c15e4af298fbc6baefef2e920d2d5
parent59cfc750f537b973e17583ce8f14a913401a5ac0
drm/i915: Fix a potential UAF at device unload

i915_gem_drain_freed_objects() might not be enough to
free all the objects and RCU delayed work might get
scheduled after the i915 device struct gets freed.

Call i915_gem_drain_workqueue() to catch all RCU delayed work.

Suggested-by: Chris Wilson <chris.p.wilson@intel.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220923073515.23093-1-nirmoy.das@intel.com
drivers/gpu/drm/i915/i915_gem.c