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: defio: Disconnect deferred I/O from the lifetime of struct fb_info
Date: Tue, 05 May 2026 08:15:16 +1000	[thread overview]
Message-ID: <review-overall-20260504141938.2378270-1-sashal@kernel.org> (raw)
In-Reply-To: <20260504141938.2378270-1-sashal@kernel.org>

Overall Series Review

Subject: fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info
Author: Sasha Levin <sashal@kernel.org>
Patches: 1
Reviewed: 2026-05-05T08:15:16.910081

---

This is a single patch being backported to 6.18.y stable from upstream commit `9ded47ad003f`. It introduces a reference-counted `struct fb_deferred_io_state` to decouple the lifetime of deferred I/O state from `struct fb_info`, fixing a long-standing use-after-free on device hot-unplug while userspace still holds active framebuffer mappings.

The design is sound: a kref-managed state object is allocated at `fb_deferred_io_init()`, each VMA takes a reference via `vm_ops->open/close`, and the info pointer is NULLed under mutex during cleanup so that subsequent fault/mkwrite accesses return `VM_FAULT_SIGBUS` instead of accessing freed memory.

The stable backport adaptation (`kzalloc_obj` → `kzalloc(sizeof(*fbdefio_state), GFP_KERNEL)`) is correctly noted. The pagereflist, open_count, and mapping remain in their original locations (`fb_deferred_io` / `fb_info`), which is appropriate for a minimal backport — drm-next has since moved those into the state struct in follow-up commits.

**Recommendation: Acceptable for stable.** The patch is a faithful minimal backport of an important fix. The concerns noted below are either pre-existing in the upstream code or relate to follow-up work not included in this backport.

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-04 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2026050146-growl-viselike-2a67@gregkh>
2026-05-04 14:19 ` [PATCH 6.18.y] fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info Sasha Levin
2026-05-04 22:15   ` Claude Code Review Bot [this message]
2026-05-04 22:15   ` Claude review: " Claude Code Review Bot
2026-02-24  8:25 [PATCH v2 0/4] fbdev: defio: Protect against device/module removal Thomas Zimmermann
2026-02-24  8:25 ` [PATCH v2 1/4] fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info Thomas Zimmermann
2026-02-27  5:29   ` 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-20260504141938.2378270-1-sashal@kernel.org \
    --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