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:05:53 +1000 [thread overview]
Message-ID: <review-overall-20260602080415.171378-1-zenghongling@kylinos.cn> (raw)
In-Reply-To: <20260602080415.171378-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:05:53.596691
---
This is a single patch fixing a real use-after-free race condition in the omapfb driver's `mmap` path. The analysis in the commit message is accurate and well-explained: `omapfb_mmap()` takes a reference to `rg` via `omapfb_get_mem_region(ofbi->region)`, but then calls `omapfb_get_region_paddr(ofbi)` which re-dereferences `ofbi->region` — a pointer that can be changed concurrently by `OMAPFB_SETUP_PLANE`. This means `start` and `len` can come from a different region than the one whose `map_count` gets incremented, allowing the actual mapped region to be freed.
The fix is correct in principle: it reads `start` and `len` directly from `rg` (the locked region) rather than going through helpers that re-read `ofbi->region`. This ensures all values are consistent with the region being reference-counted.
**Verdict: The patch is correct and should be accepted**, with one minor observation below.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-06-04 3:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 8:04 [PATCH] fbdev: omap2: fix use-after-free in omapfb_mmap Hongling Zeng
2026-06-04 3:05 ` Claude Code Review Bot [this message]
2026-06-04 3:05 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-06-02 8:54 [PATCH v2] " Hongling Zeng
2026-06-04 3:04 ` Claude review: " Claude Code Review Bot
2026-06-04 3:04 ` 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-20260602080415.171378-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