diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2021-01-28 12:22:48 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2021-01-28 12:22:48 +0300 |
commit | 9efb069de4ba748d284f6129e71de239f801053a (patch) | |
tree | 1fb80e242f68bc99732e6cbf09964faa8b74451a /fs/overlayfs | |
parent | 19c329f6808995b142b3966301f217c831e7cf31 (diff) | |
download | linux-9efb069de4ba748d284f6129e71de239f801053a.tar.xz |
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>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r-- | fs/overlayfs/super.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 2bd570cbe8a4..82cd6d55a5a1 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -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; |