From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Fix missing fops.owner in Rust DRM/misc abstractions
Date: Mon, 25 May 2026 20:45:42 +1000 [thread overview]
Message-ID: <review-overall-20260521-fix-fops-owner-v2-0-fd99079c5a04@linux.dev> (raw)
In-Reply-To: <20260521-fix-fops-owner-v2-0-fd99079c5a04@linux.dev>
Overall Series Review
Subject: Fix missing fops.owner in Rust DRM/misc abstractions
Author: Alvin Sun <alvin.sun@linux.dev>
Patches: 8
Reviewed: 2026-05-25T20:45:42.806892
---
This is a well-motivated fix for a real use-after-free bug in Rust DRM/miscdevice drivers. When `fops.owner` is NULL, the kernel cannot take a module reference when a file descriptor is opened, allowing `rmmod` to proceed while userspace still holds an open fd — leading to the NULL pointer dereference shown in the cover letter's backtrace.
The design is clean: move `THIS_MODULE` into the existing `ModuleMetadata` trait, have the `#[vtable]` macro auto-inject a `ThisModule` associated type (trait side) and auto-set it to `crate::LocalModule` (impl side), then thread that through to `fops.owner` in DRM and miscdevice. Patches 6-7 are straightforward usage-site updates for configfs and rnull.
The series is logically ordered: infrastructure first (patches 1-3), then the actual bug fixes (patches 4-5), then mechanical updates (patches 6-7). The approach of encoding the module identity as a type-level associated type is a reasonable Rust-idiomatic choice that avoids runtime parameters.
**Overall assessment: Good series that fixes a real security/stability bug. A few minor observations below, but nothing blocking.**
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-05-25 10:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 7:52 [PATCH v2 0/7] Fix missing fops.owner in Rust DRM/misc abstractions Alvin Sun
2026-05-21 7:52 ` [PATCH v2 1/7] rust: module: add `THIS_MODULE` const to `ModuleMetadata` trait Alvin Sun
2026-05-25 10:45 ` Claude review: " Claude Code Review Bot
2026-05-21 7:52 ` [PATCH v2 2/7] rust: macros: auto-insert ThisModule in #[vtable] Alvin Sun
2026-05-25 10:45 ` Claude review: " Claude Code Review Bot
2026-05-21 7:52 ` [PATCH v2 3/7] rust: doctest: add LocalModule fallback for #[vtable] ThisModule Alvin Sun
2026-05-25 10:45 ` Claude review: " Claude Code Review Bot
2026-05-21 7:52 ` [PATCH v2 4/7] rust: drm: set fops.owner from driver module pointer Alvin Sun
2026-05-25 10:45 ` Claude review: " Claude Code Review Bot
2026-05-21 7:52 ` [PATCH v2 5/7] rust: miscdevice: " Alvin Sun
2026-05-25 10:45 ` Claude review: " Claude Code Review Bot
2026-05-21 7:52 ` [PATCH v2 6/7] rust: configfs: use `LocalModule` for `THIS_MODULE` Alvin Sun
2026-05-25 10:45 ` Claude review: " Claude Code Review Bot
2026-05-21 7:52 ` [PATCH v2 7/7] block: rnull: " Alvin Sun
2026-05-25 10:45 ` Claude review: " Claude Code Review Bot
2026-05-25 10:45 ` Claude Code Review Bot [this message]
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-20260521-fix-fops-owner-v2-0-fd99079c5a04@linux.dev \
--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