From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: accel/qaic: Protect perf stats BO state with bo->lock
Date: Mon, 25 May 2026 17:54:33 +1000 [thread overview]
Message-ID: <review-overall-6a115824.a0bed9bd.3c0137.9edf@mx.google.com> (raw)
In-Reply-To: <6a115824.a0bed9bd.3c0137.9edf@mx.google.com>
Overall Series Review
Subject: accel/qaic: Protect perf stats BO state with bo->lock
Author: Shuvam Pandey <shuvampandey1@gmail.com>
Patches: 1
Reviewed: 2026-05-25T17:54:33.288980
---
This is a single-patch series that fixes a real TOCTOU race condition in the QAIC accelerator driver. The `qaic_perf_stats_bo_ioctl()` function reads `bo->sliced` and `bo->dbc` without holding `bo->lock`, while the detach path (`detach_slice_bo` -> `qaic_init_bo` / `qaic_unprepare_bo`) modifies these fields under `bo->lock`. The fix correctly acquires `bo->lock` before validating and reading the BO state.
The fix is **correct and well-structured**. The locking scope is appropriate -- it protects both the validation checks (`bo->sliced`, `bo->dbc->id`) and the perf stats reads (`bo->perf_stats.*`, `bo->total_slice_nents`). The error-path refactoring is clean: it collapses duplicate `drm_gem_object_put` calls into a single site, using the `unlock_bo` / `put_obj` label chain consistently.
One minor concern below, but overall this is a good fix.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-05-25 7:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 7:32 [PATCH] accel/qaic: Protect perf stats BO state with bo->lock Shuvam Pandey
2026-05-25 7:54 ` Claude review: " Claude Code Review Bot
2026-05-25 7:54 ` 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-6a115824.a0bed9bd.3c0137.9edf@mx.google.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