public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Re: [PATCH] drm/amdgpu: fix PASID task_info lookup race
Date: Wed, 11 Mar 2026 13:51:08 +1000	[thread overview]
Message-ID: <review-overall-01de9910-3fe6-4683-b005-f41103a9bf89@amd.com> (raw)
In-Reply-To: <01de9910-3fe6-4683-b005-f41103a9bf89@amd.com>

Overall Series Review

Subject: Re: [PATCH] drm/amdgpu: fix PASID task_info lookup race
Author: =?UTF-8?Q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>
Patches: 2
Reviewed: 2026-03-11T13:51:08.979104

---

This is a single-patch fix for a real use-after-free race condition in `amdgpu_vm_get_task_info_pasid()`. The race is between the PASID lookup path and `amdgpu_vm_fini()`:

1. Thread A calls `amdgpu_vm_get_vm_from_pasid()`, gets a pointer to the VM, releases the xarray lock.
2. Thread B runs `amdgpu_vm_fini()`, calls `xa_erase_irq()` to remove the PASID mapping, then eventually calls `amdgpu_vm_put_task_info()` which may free `task_info`.
3. Thread A dereferences `vm->task_info` — use-after-free.

The fix correctly collapses the lookup and reference acquisition into a single critical section under the xarray lock. The approach is sound and well-motivated.

**Verdict: The patch is correct and should be accepted, with minor observations below.**

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-03-11  3:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260309160403.599472-1-fanwu01@zju.edu.cn>
2026-03-09 16:54 ` [PATCH] drm/amdgpu: fix PASID task_info lookup race Christian König
2026-03-10  0:58   ` [PATCH v2] " Fan Wu
2026-03-11  3:51   ` Claude Code Review Bot [this message]
2026-03-11  3:51   ` Claude review: Re: [PATCH] " Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-overall-01de9910-3fe6-4683-b005-f41103a9bf89@amd.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox