Skip to content

Commit 9efb069

Browse files
author
Miklos Szeredi
committed
ovl: add warning on user_ns mismatch
Currently there's no way to create an overlay filesystem outside of the current user namespace. Make sure that if this assumption changes it doesn't go unnoticed. Reported-by: "Eric W. Biederman" <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 19c329f commit 9efb069

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/overlayfs/super.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,6 +1923,10 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
19231923
unsigned int numlower;
19241924
int err;
19251925

1926+
err = -EIO;
1927+
if (WARN_ON(sb->s_user_ns != current_user_ns()))
1928+
goto out;
1929+
19261930
sb->s_d_op = &ovl_dentry_operations;
19271931

19281932
err = -ENOMEM;

0 commit comments

Comments
 (0)