[RFC PATCH v2 24/41] shmem, ramfs: allow UUID and GUID owners

Jan Koester jan.koester at tuxist.de
Wed Oct 21 03:15:44 UTC 2026


Both keep inode owners in memory only, so they can hold any kuid_t.
Set SB_I_UID_R. Quotas of tmpfs don't account such owners.

Assisted-by: Claude:claude-opus-5-5

Signed-off-by: Jan Koester <jan.koester at tuxist.de>
---
 fs/ramfs/inode.c | 1 +
 mm/shmem.c       | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 0a88ede48e..510dc2a78f 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -269,6 +269,7 @@ static int ramfs_fill_super(struct super_block *sb, struct fs_context *fc)
 	sb->s_op		= &ramfs_ops;
 	sb->s_d_flags		= DCACHE_DONTCACHE;
 	sb->s_time_gran		= 1;
+	sb->s_iflags		|= SB_I_UID_R;
 
 	inode = ramfs_get_inode(sb, NULL, S_IFDIR | fsi->mount_opts.mode, 0);
 	sb->s_root = d_make_root(inode);
diff --git a/mm/shmem.c b/mm/shmem.c
index 848316eaa7..b54775e0c3 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4988,6 +4988,8 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc)
 	}
 	sb->s_export_op = &shmem_export_ops;
 	sb->s_flags |= SB_NOSEC;
+	/* owners live in the inode only: UUIDs and GUIDs need no format */
+	sb->s_iflags |= SB_I_UID_R;
 
 #if IS_ENABLED(CONFIG_UNICODE)
 	if (!ctx->encoding && ctx->strict_encoding) {
-- 
2.56.0




More information about the Linux-security-module-archive mailing list