Skip to content

drm/xe: Rework buffer object refcounting

Thomas Hellström requested to merge thomash/kernel:refcount into xe

Adding a warning printout in the object release callback shows that we typically release objects with a gem reference remaining. That's because xe_bo_put() frees the ttm_buffer_object reference that is owned by the gem object. Worse, by doing this, we may free objects that have multiple gem object references grabbed by the gem layer, causing potential uafs. Fix this by consistenly using the gem kref throughout the driver instead of the ttm_buffer_object kref. This is the way other driver typically handles the dual krefs. Update the documentation.

Signed-off-by: Thomas Hellström thomas.hellstrom@linux.intel.com

Edited by Thomas Hellström

Merge request reports

Loading