[PATCH 0/5] Have xe_vm and xe_exec_queue take references to xef

Lucas De Marchi lucas.demarchi at intel.com
Mon Jul 8 21:37:10 UTC 2024


On Mon, Jul 08, 2024 at 01:20:58PM GMT, Umesh Nerlige Ramappa wrote:
>xe_file_close triggers an asynchronous queue cleanup and then frees up
>the xef object. Since queue cleanup flushes all pending jobs and the KMD
>stores client usage stats into the xef object after jobs are flushed, we
>see a use-after-free for the xef object. Resolve this by taking a
>reference to xef from it's users - xe_exec_queue and xe_vm.
>
>Issue: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1908
>
>@Maintainers
>I need to use the below tags in the patches, but not sure which patches
>to apply these on since all patches are part of the fix.
>
>Fixes: 6109f24f87d7 ("drm/xe: Add helper to accumulate exec queue runtime")
>Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1908

I think we can merge the first prep patches, and then use the stable
syntax as detailed in docs:

	Additionally, some patches submitted via Option 1 may have
	additional patch prerequisites which can be cherry-picked. This
	can be specified in the following format in the sign-off area:

	Cc: <stable at vger.kernel.org> # 3.3.x: a1f84a3: sched: Check for idle
	Cc: <stable at vger.kernel.org> # 3.3.x: 1b9508f: sched: Rate-limit newidle
	Cc: <stable at vger.kernel.org> # 3.3.x: fd21073: sched: Fix affinity logic
	Cc: <stable at vger.kernel.org> # 3.3.x
	Signed-off-by: Ingo Molnar <mingo at elte.hu>

However we should probably squash the last 2 patches and then make it
have 2 Fixes: pointing to both the first original commit and the fix
being replaced since it was not a complete fix.

Lucas De Marchi

>
>Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
>
>Umesh Nerlige Ramappa (5):
>  drm/xe: Move part of xe_file cleanup to a helper
>  drm/xe: Add ref counting for xe_file
>  drm/xe: Take a reference to xe file when user creates exec_queue
>  drm/xe: Take a ref to xe file when user creates a VM
>  Revert "drm/xe: Do not access xe file when updating exec queue
>    run_ticks"
>
> drivers/gpu/drm/xe/xe_device.c           | 39 +++++++++++++++---------
> drivers/gpu/drm/xe/xe_device.h           | 12 ++++++++
> drivers/gpu/drm/xe/xe_device_types.h     |  3 ++
> drivers/gpu/drm/xe/xe_drm_client.c       |  5 +--
> drivers/gpu/drm/xe/xe_exec_queue.c       | 11 ++++++-
> drivers/gpu/drm/xe/xe_exec_queue_types.h |  7 ++---
> drivers/gpu/drm/xe/xe_vm.c               |  5 ++-
> 7 files changed, 58 insertions(+), 24 deletions(-)
>
>-- 
>2.38.1
>


More information about the Intel-xe mailing list