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: drm/amdgpu: fix use-after-free in userq signal/wait IOCTLs
Date: Tue, 10 Mar 2026 12:44:42 +1000	[thread overview]
Message-ID: <review-overall-20260309022229.63071-1-chenyuan_mi@163.com> (raw)
In-Reply-To: <20260309022229.63071-1-chenyuan_mi@163.com>

Overall Series Review

Subject: drm/amdgpu: fix use-after-free in userq signal/wait IOCTLs
Author: Chenyuan Mi <chenyuan_mi@163.com>
Patches: 5
Reviewed: 2026-03-10T12:44:42.922557

---

This 2-patch series aims to fix use-after-free bugs in the amdgpu userqueue signal and wait IOCTLs by adding mutex protection around queue lookups. The identified race conditions are real: without lifetime protection, a concurrent `AMDGPU_USERQ_OP_FREE` can destroy a queue between `xa_load()` and subsequent dereferences.

**However, these patches are based on an older version of the code and are already superseded by changes in the current drm-next tree.** The current tree (as seen at `amdgpu_userq_fence.c:522` and `:866`) has replaced the raw `xa_load()` calls with `amdgpu_userq_get()`/`amdgpu_userq_put()`, which use `kref` refcounting to protect the queue lifetime. This refcounting approach is a better fix — it takes a reference under the xa_lock, preventing the queue from being freed while in use, without needing to hold `userq_mutex` across the entire operation.

**Recommendation: NAK — these patches are not needed against current drm-next.**

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-03-10  2:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09  2:22 [PATCH 0/2] drm/amdgpu: fix use-after-free in userq signal/wait IOCTLs Chenyuan Mi
2026-03-09  2:22 ` [PATCH 1/2] drm/amdgpu: protect waitq access with userq_mutex in wait IOCTL Chenyuan Mi
2026-03-09 10:07   ` Christian König
2026-03-10  2:44     ` Claude review: " Claude Code Review Bot
2026-03-09  2:22 ` [PATCH 2/2] drm/amdgpu: protect queue access in signal IOCTL Chenyuan Mi
2026-03-09 10:09   ` Christian König
2026-03-10  2:44     ` Claude review: " Claude Code Review Bot
2026-03-10  2:44 ` Claude Code Review Bot [this message]

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-20260309022229.63071-1-chenyuan_mi@163.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