Skip to content

fs/vfs: enforce pseudoFS permissions on open()#18891

Merged
acassis merged 1 commit into
apache:masterfrom
Abhishekmishra2808:fs/inode-checkperm-open
May 17, 2026
Merged

fs/vfs: enforce pseudoFS permissions on open()#18891
acassis merged 1 commit into
apache:masterfrom
Abhishekmishra2808:fs/inode-checkperm-open

Conversation

@Abhishekmishra2808
Copy link
Copy Markdown
Contributor

@Abhishekmishra2808 Abhishekmishra2808 commented May 17, 2026

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
image
image

Ostest and checkpatch tests also passed.

@github-actions github-actions Bot added Area: File System File System issues Size: M The size of the change in this PR is medium labels May 17, 2026
Comment thread fs/vfs/fs_open.c Outdated
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>
@Abhishekmishra2808 Abhishekmishra2808 force-pushed the fs/inode-checkperm-open branch from 1a8ebdd to fa20a83 Compare May 17, 2026 13:23
@acassis acassis merged commit 702fd85 into apache:master May 17, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: File System File System issues Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants