Skip to content

fs/vfs: inherit ownership in pseudofile_create#19049

Open
Abhishekmishra2808 wants to merge 1 commit into
apache:masterfrom
Abhishekmishra2808:fs/pseudofs-create-ownership
Open

fs/vfs: inherit ownership in pseudofile_create#19049
Abhishekmishra2808 wants to merge 1 commit into
apache:masterfrom
Abhishekmishra2808:fs/pseudofs-create-ownership

Conversation

@Abhishekmishra2808

@Abhishekmishra2808 Abhishekmishra2808 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Note: Please adhere to Contributing Guidelines.

Summary

Initialize pseudo-file ownership from the creating task's effective credentials when a new pseudo-file is created through the O_CREAT path.
Part of GSoC #18458

Impact

When both CONFIG_PSEUDOFS_ATTRIBUTES and CONFIG_SCHED_USER_IDENTITY are enabled, newly created pseudo-files now inherit:

  • i_owner = tg_euid
  • i_group = tg_egid

instead of remaining owned by the default root credentials.

Testing

Tested with a custom test file.
WhatsApp Image 2026-06-06 at 8 57 12 PM

@github-actions github-actions Bot added Area: File System File System issues Size: S The size of the change in this PR is small labels Jun 6, 2026
@Abhishekmishra2808 Abhishekmishra2808 force-pushed the fs/pseudofs-create-ownership branch from ac186d5 to 1600ac6 Compare June 6, 2026 16:56
Comment thread fs/vfs/fs_pseudofile.c Outdated
Initialize i_owner and i_group from the creating task's
effective uid/gid when a pseudo-file is created via O_CREAT.

This aligns pseudo-file ownership with the creator's
effective credentials instead of leaving new files
root-owned by default.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
@Abhishekmishra2808 Abhishekmishra2808 force-pushed the fs/pseudofs-create-ownership branch from 1600ac6 to c2bbee1 Compare June 6, 2026 22:21
Comment thread fs/vfs/fs_pseudofile.c
rtcb = nxsched_self();
if (rtcb != NULL && rtcb->group != NULL)
{
(*node)->i_owner = rtcb->group->tg_euid;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to move the initialize into inode_reserve

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: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants