[PATCH] drm/xe: Fix NULL ptr dereference in devcoredump
Souza, Jose
jose.souza at intel.com
Thu May 30 20:55:05 UTC 2024
On Thu, 2024-05-30 at 13:33 -0700, Matthew Brost wrote:
> Kernel VM do not have an Xe file. Include a check for Xe file in the VM
> before trying to get pid from VM's Xe file when taking a devcoredump.
>
Reviewed-by: José Roberto de Souza <jose.souza at intel.com>
> Fixes: b10d0c5e9df7 ("drm/xe: Add process name to devcoredump")
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: José Roberto de Souza <jose.souza at intel.com>
> Cc: stable at vger.kernel.org
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> ---
> drivers/gpu/drm/xe/xe_devcoredump.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c
> index 1643d44f8bc4..6f63b8e4e3b9 100644
> --- a/drivers/gpu/drm/xe/xe_devcoredump.c
> +++ b/drivers/gpu/drm/xe/xe_devcoredump.c
> @@ -176,7 +176,7 @@ static void devcoredump_snapshot(struct xe_devcoredump *coredump,
> ss->snapshot_time = ktime_get_real();
> ss->boot_time = ktime_get_boottime();
>
> - if (q->vm) {
> + if (q->vm && q->vm->xef) {
> task = get_pid_task(q->vm->xef->drm->pid, PIDTYPE_PID);
> if (task)
> process_name = task->comm;
More information about the Intel-xe
mailing list