Commit 9efb069d authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

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: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 19c329f6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;