mirror of https://gitee.com/openkylin/linux.git
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" <ebiederm@xmission.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
19c329f680
commit
9efb069de4
|
@ -1923,6 +1923,10 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
|
|||
unsigned int numlower;
|
||||
int err;
|
||||
|
||||
err = -EIO;
|
||||
if (WARN_ON(sb->s_user_ns != current_user_ns()))
|
||||
goto out;
|
||||
|
||||
sb->s_d_op = &ovl_dentry_operations;
|
||||
|
||||
err = -ENOMEM;
|
||||
|
|
Loading…
Reference in New Issue