From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/logicvc: Avoid use-after-free with devm_kzalloc() Date: Thu, 04 Jun 2026 14:34:10 +1000 Message-ID: In-Reply-To: <20260601-logicvc-uaf-v1-1-8c9ca5b3429c@bootlin.com> References: <20260601-logicvc-uaf-v1-1-8c9ca5b3429c@bootlin.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Overall Series Review Subject: drm/logicvc: Avoid use-after-free with devm_kzalloc() Author: Romain Gantois Patches: 2 Reviewed: 2026-06-04T14:34:10.308240 --- This is a single well-motivated patch converting the logicvc driver from `devm_kzalloc`-based allocation to DRM-managed (`drmm_*`) allocation for planes, CRTCs, encoders, and connectors. The core problem is real and well-understood: `devm`-managed structs can be freed before the DRM core is done with them (device unbind frees `devm` resources, but userspace may still hold DRM file handles), leading to use-after-free. The author confirms this was observed via KASAN on v6.6. The approach is correct and follows the standard pattern that many other DRM drivers have adopted. The API usage is verified correct against the kernel headers. Error handling simplification is appropriate since `drmm_*` resources are automatically cleaned up on DRM device release. **Verdict: Patch looks good.** A couple of minor style nits below, nothing blocking. --- --- Generated by Claude Code Patch Reviewer