fs/vfs: enforce pseudoFS permissions on open()#18891
Merged
acassis merged 1 commit intoMay 17, 2026
Merged
Conversation
Add inode_checkperm() and integrate it into file_vopen() to enforce UNIX-style read/write permission checks for pseudoFS inodes using effective uid/gid credentials. Skip permission enforcement for mountpoint inodes and allow kernel threads to bypass checks. Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
1a8ebdd to
fa20a83
Compare
xiaoxiang781216
approved these changes
May 17, 2026
acassis
approved these changes
May 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This patch adds centralized UNIX-style permission enforcement for pseudo-filesystem inodes during open() operations. It introduces inode_checkperm() and integrates it into file_vopen() after inode_checkflags() to validate read and write access using inode ownership, permission bits, and the effective uid/gid of the calling task. The implementation supports owner/group/other permission evaluation, bypasses permission checks for kernel threads, and skips mountpoint inodes to avoid affecting mounted filesystems such as FAT, ROMFS, and procfs.
Part of GSoC #18458
Impact
This change introduces the active runtime permission enforcement layer for pseudoFS instead of storing permission metadata. Read-only, write-only, and inaccessible inode modes are now properly enforced during file open operations, returning -EACCES when access is denied.
Testing
NSH


Ostest and checkpatch tests also passed.