From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: libfs: set SB_I_NOEXEC and SB_I_NODEV by default in init_pseudo()
Date: Fri, 05 Jun 2026 06:45:30 +1000 [thread overview]
Message-ID: <review-patch1-20260604025315.245910-2-jhubbard@nvidia.com> (raw)
In-Reply-To: <20260604025315.245910-2-jhubbard@nvidia.com>
Patch Review
**Status: Looks good.**
The change is a single line addition in `fs/libfs.c:739`:
```c
fc->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
```
placed right after the existing `fc->sb_flags |= SB_NOUSER;`. This is the natural location — these flags are logically coupled with `SB_NOUSER` since pseudo-filesystems are never path-reachable.
**Correctness analysis:**
- **`SB_I_NODEV`** is inert on `SB_NOUSER` mounts since device nodes on unreachable mounts can never be opened via path. Adding it to callers that lacked it (aio, dma-buf, socket, pipe, resource, erofs, btrfs-tests, vfio, drm, dax, bdev) is harmless.
- **`SB_I_NOEXEC`** has one observable effect: `mmap()` with `PROT_EXEC` on a pseudo-fs fd will now return `-EPERM` for callers that didn't previously set this flag. The commit message correctly states no in-tree caller maps these fds executable, which is reasonable — there's no use case for executable mappings of sockets, pipes, dma-bufs, DRM fds, etc.
- The `|=` operator preserves any flags already set by callers before `init_pseudo()`, and callers that set the same flags after `init_pseudo()` are simply redundant (cleaned up in patch 2).
- The `Fixes:` tag, `Cc: stable`, and reproducer instructions are all appropriate.
**One minor note:** The commit message says "No in-tree caller maps these executable." A stronger statement might reference that `PROT_EXEC` on a dma-buf would be nonsensical since the backing pages are GPU memory / DMA coherent allocations. But this is a commit message style preference, not a correctness issue.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-06-04 20:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 2:53 [PATCH v3 0/2] libfs: set SB_I_NOEXEC and SB_I_NODEV in init_pseudo() John Hubbard
2026-06-04 2:53 ` [PATCH v3 1/2] libfs: set SB_I_NOEXEC and SB_I_NODEV by default " John Hubbard
2026-06-04 20:45 ` Claude Code Review Bot [this message]
2026-06-04 2:53 ` [PATCH v3 2/2] libfs: drop redundant SB_I_NOEXEC/SB_I_NODEV in init_pseudo() callers John Hubbard
2026-06-04 20:45 ` Claude review: " Claude Code Review Bot
2026-06-04 20:45 ` Claude review: libfs: set SB_I_NOEXEC and SB_I_NODEV in init_pseudo() 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-patch1-20260604025315.245910-2-jhubbard@nvidia.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