Re: [PATCH v5 3/5] drm/nouveau: Fix drm_driver struct/nouveau.atomic parameter handling
Dave Airlie <[email protected]> Mon, 3 Aug 2026 15:28:12 +1000
| Newsgroups | dev.linux.lists.sashiko-reviews,org.freedesktop.lists.dri-devel |
|---|---|
| Message-ID | <CAPM=9tzFg34jBT7-YYncOoYfvpvXvGnymuYeR6pQ2bQ4qeV4=g@mail.gmail.com> |
On Fri, 31 Jul 2026 at 07:13, <[email protected]> wrote: > > Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: > > New issues: > - [Critical] Embedding `drm_driver` inside `nouveau_drm` causes a Use-After-Free of `dev->driver` in the DRM core when the device is unbound or hot-unplugged while userspace holds an open file descriptor. I'm going to agree with sashiko here. We don't want to embed it. Just create two copies of the struct, one with atomic and one without, or use some macros to do that, because anything else is just going to have messy lifetimes. I think you could also move the atomic flag handling earlier. Dave.