From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: drm: Higher-Ranked Lifetime private data Date: Thu, 04 Jun 2026 12:03:16 +1000 Message-ID: In-Reply-To: <20260603011711.2077361-1-dakr@kernel.org> References: <20260603011711.2077361-1-dakr@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: rust: drm: Higher-Ranked Lifetime private data Author: Danilo Krummrich Patches: 13 Reviewed: 2026-06-04T12:03:16.472487 --- This is a well-designed 7-patch series from Danilo Krummrich that addresses= a real soundness gap in the Rust DRM abstractions: ioctl handlers run in p= rocess context with no guarantee that the parent bus device is still bound.= The series introduces: 1. **`ParentDevice` associated type** =E2=80=94 type-level declaration of t= he bus device type 2. **`UnbindGuard`** =E2=80=94 RAII guard wrapping `drm_dev_enter()`/`drm_d= ev_exit()` SRCU critical sections 3. **`RegistrationData`** =E2=80=94 a `ForLt` associated type for data whos= e lifetime is tied to the binding scope, accessed safely through an HRTB cl= osure 4. **Ioctl integration** =E2=80=94 the dispatch macro wraps every handler i= n an UnbindGuard, automatically returning `ENODEV` on hot-unplug The overall architecture is sound. The `drm_dev_unplug()` switch is correct= =E2=80=94 it sets `unplugged =3D true`, calls `synchronize_srcu()`, then `= drm_dev_unregister()`, which guarantees that any `UnbindGuard` that success= fully acquired the lock sees the device as bound, and `Registration::drop()= ` waits for all such critical sections to complete before dropping `reg_dat= a`. The HRTB on `registration_data_with()` correctly prevents lifetime smug= gling for invariant types. A few concerns are noted below, mostly around safety documentation and a po= tential ordering subtlety. --- Generated by Claude Code Patch Reviewer