From: Claude Code Review Bot <claude-review@example.com>
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 [thread overview]
Message-ID: <review-patch2-20260521-dmabuf-limit-access-v1-2-26c01e27365a@redhat.com> (raw)
In-Reply-To: <20260521-dmabuf-limit-access-v1-2-26c01e27365a@redhat.com>
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 (incorrectly), which would help catch the bug.
**Missing test: derived fd outlives primary fd**
An important lifecycle scenario — close the original RW fd first, then 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 = 9 new, giving 11+9 = 20 per heap.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 10:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 9:10 [PATCH 0/2] dma-buf: add DMA_BUF_IOCTL_DERIVE for reduced-permission aliases Albert Esteve
2026-05-21 9:10 ` [PATCH 1/2] " Albert Esteve
2026-05-21 12:30 ` Christian König
2026-05-25 10:27 ` Claude review: " Claude Code Review Bot
2026-05-21 9:10 ` [PATCH 2/2] selftests: dma-buf: add DERIVE ioctl tests Albert Esteve
2026-05-25 10:27 ` Claude Code Review Bot [this message]
2026-05-21 12:28 ` [PATCH 0/2] dma-buf: add DMA_BUF_IOCTL_DERIVE for reduced-permission aliases Christian König
2026-05-21 13:01 ` Albert Esteve
2026-05-21 13:14 ` Christian König
2026-05-25 10:27 ` Claude review: " Claude Code Review Bot
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-patch2-20260521-dmabuf-limit-access-v1-2-26c01e27365a@redhat.com \
--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