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/panthor: Avoid potential UAF due to memory reclaim
Date: Sun, 12 Apr 2026 09:28:38 +1000	[thread overview]
Message-ID: <review-overall-20260410195050.687201-1-akash.goel@arm.com> (raw)
In-Reply-To: <20260410195050.687201-1-akash.goel@arm.com>

Overall Series Review

Subject: drm/panthor: Avoid potential UAF due to memory reclaim
Author: Akash Goel <akash.goel@arm.com>
Patches: 1
Reviewed: 2026-04-12T09:28:38.331168

---

This is a single-patch fix for a real use-after-free vulnerability in the panthor GPU driver's shrinker path. The bug was introduced by `fb42964e2a76 ("drm/panthor: Add a GEM shrinker")`. The scenario is:

1. Shrinker evicts a BO, invalidating all GPU mappings and setting `vm_bo->evicted = true`.
2. A new GPU mapping is subsequently created for that BO (adding a VA to the same vm_bo).
3. The BO goes back onto a reclaim list due to the new mapping.
4. Shrinker fires again — but the old code's `if (vm_bo->evicted) continue` skips the entire vm_bo, **including** the VA walk that would tear down the new mapping.
5. Backing pages are freed while still GPU-mapped → UAF.

The fix is correct and well-targeted: it removes the early `continue` and instead only gates the `drm_gpuvm_bo_evict()` call on the evicted flag, while always running the VA invalidation loop.

**Verdict: The patch is correct and fixes a real vulnerability. One minor comment accuracy issue noted below.**

---

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-04-11 23:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 19:50 [PATCH] drm/panthor: Avoid potential UAF due to memory reclaim Akash Goel
2026-04-11 23:28 ` Claude review: " Claude Code Review Bot
2026-04-11 23:28 ` Claude Code Review Bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-04-13  8:02 [PATCH v2] " Akash Goel
2026-04-13  8:43 ` Claude review: " Claude Code Review Bot
2026-04-13  8:43 ` 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-20260410195050.687201-1-akash.goel@arm.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