From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: selftests: dma-buf: add DERIVE ioctl tests Date: Mon, 25 May 2026 20:27:33 +1000 Message-ID: In-Reply-To: <20260521-dmabuf-limit-access-v1-2-26c01e27365a@redhat.com> References: <20260521-dmabuf-limit-access-v1-0-26c01e27365a@redhat.com> <20260521-dmabuf-limit-access-v1-2-26c01e27365a@redhat.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Good coverage for the happy path.** `test_ro_derive` verifies: - Allocation, derivation as `O_RDONLY` - RW mmap on the original fd - RO mmap on the derived fd - Data visibility (write through RW, read through RO) **Good negative tests.** `test_ro_derive_escalation` verifies: - `O_RDWR` derivation from read-only fd is rejected with `EACCES` - `PROT_WRITE | MAP_SHARED` mmap on read-only fd is rejected with `EACCES` **Missing test: O_WRONLY escalation** Given the bug in patch 1, there should be a test deriving `O_WRONLY` from a= read-only fd and confirming it's rejected. Currently this would pass (inco= rrectly), which would help catch the bug. **Missing test: derived fd outlives primary fd** An important lifecycle scenario =E2=80=94 close the original RW fd first, t= hen verify the derived RO fd still works (mmap, read data). This exercises = the refcount path where `dma_buf_file_release` on the derived file triggers= `dma_buf_put`. **Test plan count is correct.** `setup_ro_derive` emits 2 results; `test_ro= _derive` adds 3; `test_ro_derive_escalation` adds 2. Total: 2+3 + 2+2 =3D 9= new, giving 11+9 =3D 20 per heap. --- Generated by Claude Code Patch Reviewer