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:modedb: fix a possible UAF in fb_find_mode()
Date: Wed, 27 May 2026 15:06:24 +1000	[thread overview]
Message-ID: <review-overall-20260526091507.421730-1-islituo@gmail.com> (raw)
In-Reply-To: <20260526091507.421730-1-islituo@gmail.com>

Overall Series Review

Subject: fbdev:modedb: fix a possible UAF in fb_find_mode()
Author: Tuo Li <islituo@gmail.com>
Patches: 1
Reviewed: 2026-05-27T15:06:24.893069

---

This is a single patch claiming to fix a use-after-free (UAF) in `fb_find_mode()`. The claimed bug is that `mode_option_buf` (a `kstrdup`'d buffer from `fb_get_options`) is freed while the pointer `name`, which aliases it, is still in use.

**The bug claim is valid in the original code.** In the original code, `kfree(mode_option_buf)` was placed at the `done:` label, immediately before the CVT path and the database-search loop. The `name` pointer (which may alias `mode_option_buf`) is then used in the `name_matches()` call at line 783. This is a genuine UAF when `mode_option` was originally NULL and got populated from `fb_get_options`.

**However, the fix is incomplete and introduces new bugs.** It misses several return paths that still leak `mode_option_buf`.

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-27  5:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26  9:15 [PATCH] fbdev:modedb: fix a possible UAF in fb_find_mode() Tuo Li
2026-05-27  5:06 ` Claude Code Review Bot [this message]
2026-05-27  5:06 ` Claude review: " 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-20260526091507.421730-1-islituo@gmail.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