From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Re: [PATCH 1/2] drm/amdgpu: protect waitq access with userq_mutex in wait IOCTL
Date: Tue, 10 Mar 2026 12:44:43 +1000 [thread overview]
Message-ID: <review-patch1-91221541-6d21-44a2-a9b2-f1a30c27327a@amd.com> (raw)
In-Reply-To: <91221541-6d21-44a2-a9b2-f1a30c27327a@amd.com>
Patch Review
**Already fixed upstream via refcounting.** The current tree uses:
```c
waitq = amdgpu_userq_get(userq_mgr, wait_info->waitq_id);
```
(line 866) instead of the raw `xa_load()` this patch targets. The `amdgpu_userq_get()` function takes a kref under xa_lock, and `amdgpu_userq_put()` is called at the end (line 951), providing proper lifetime protection without holding the mutex across the entire loop.
**Even evaluated against the older base, there is a concern:**
- **Sleeping under mutex**: The patch holds `userq_mutex` across `dma_fence_wait(fences[i], true)` (line 909 in the diff context). `dma_fence_wait` with `intr=true` can sleep for an extended/unbounded period waiting for GPU work to complete. Holding `userq_mutex` during this time blocks all other userqueue operations (create, destroy, signal) for this file descriptor. This is a significant liveness concern — a slow or stalled fence would effectively deadlock the entire userqueue subsystem for the process. The refcounting approach in drm-next avoids this problem entirely.
---
Generated by Claude Code Patch Reviewer
next prev 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 Code Review Bot [this message]
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 review: drm/amdgpu: fix use-after-free in userq signal/wait IOCTLs 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-patch1-91221541-6d21-44a2-a9b2-f1a30c27327a@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