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: fbdev: omap2: fix use-after-free in omapfb_mmap
Date: Thu, 04 Jun 2026 13:04:18 +1000	[thread overview]
Message-ID: <review-overall-20260602085421.194325-1-zenghongling@kylinos.cn> (raw)
In-Reply-To: <20260602085421.194325-1-zenghongling@kylinos.cn>

Overall Series Review

Subject: fbdev: omap2: fix use-after-free in omapfb_mmap
Author: Hongling Zeng <zenghongling@kylinos.cn>
Patches: 1
Reviewed: 2026-06-04T13:04:18.710868

---

This is a single-patch series fixing a race condition between `omapfb_mmap()` and `OMAPFB_SETUP_PLANE` ioctl in the omap2 fbdev driver. The race analysis in the commit message is sound — `ofbi->region` can be reassigned concurrently, causing `omapfb_get_region_paddr()` to read from the new region while `map_count` is incremented on the old one, enabling a use-after-free.

However, the patch has a **critical bug**: it adds a new `atomic_inc(&rg->map_count)` before `vm_iomap_memory()` without removing the original increment after it. This double-increments `map_count` on the success path, leaking a reference and preventing the region from ever being freed.

Additionally, the commit message claims to fix the race on both `start` and `len`, but `len` is still read from the raceable `fix->smem_len`.

**Recommendation: Needs revision.** The double-increment must be fixed before this can be applied.

---

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-06-04  3:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02  8:54 [PATCH v2] fbdev: omap2: fix use-after-free in omapfb_mmap Hongling Zeng
2026-06-04  3:04 ` Claude review: " Claude Code Review Bot
2026-06-04  3:04 ` Claude Code Review Bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-06-02  8:04 [PATCH] " Hongling Zeng
2026-06-04  3:05 ` Claude review: " Claude Code Review Bot
2026-06-04  3:05 ` 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-20260602085421.194325-1-zenghongling@kylinos.cn \
    --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