[RFC PATCH v2 37/41] ovl: allow UUID and GUID owners when the upper layer does

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


Changes to an overlay land in its upper layer, so whether the overlay
can store UUID and GUID owners is the upper layer's business: take
SB_I_UID_R over from it. Copy-up of such an owner from a lower layer
into an upper layer without the flag keeps failing with -EOVERFLOW.

This is what a live system with a tmpfs over a read-only image needs
to give files to UUID and GUID users.

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

Signed-off-by: Jan Koester <jan.koester at tuxist.de>
---
 fs/overlayfs/super.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index bd0a3f9039..df1e451019 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1455,6 +1455,9 @@ static int ovl_fill_super_creds(struct fs_context *fc, struct super_block *sb)
 
 		sb->s_stack_depth = upper_sb->s_stack_depth;
 		sb->s_time_gran = upper_sb->s_time_gran;
+		/* changes land in the upper layer: its kinds of owner */
+		if (upper_sb->s_iflags & SB_I_UID_R)
+			sb->s_iflags |= SB_I_UID_R;
 	}
 	oe = ovl_get_lowerstack(sb, ctx, ofs, layers);
 	err = PTR_ERR(oe);
-- 
2.56.0




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