diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-07-11 15:58:35 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-07-13 22:06:45 +0200 |
commit | 8fc646b44385ff0a9853f6590497e43049eeb311 (patch) | |
tree | 80b44e698a2fc19de2ba6d59c0fb9fcdd5b416c5 /fs/overlayfs | |
parent | f4439de118283159ff165e52036134a278ebf990 (diff) | |
download | linux-8fc646b44385ff0a9853f6590497e43049eeb311.tar.gz linux-8fc646b44385ff0a9853f6590497e43049eeb311.tar.bz2 linux-8fc646b44385ff0a9853f6590497e43049eeb311.zip |
ovl: fix random return value on mount
On failure to prepare_creds(), mount fails with a random
return value, as err was last set to an integer cast of
a valid lower mnt pointer or set to 0 if inodes index feature
is enabled.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 3fe6e52f0626 ("ovl: override creds with the ones from ...")
Cc: <stable@vger.kernel.org> # v4.7
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r-- | fs/overlayfs/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 44dc2d6ffe0f..1cf5d3538309 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1090,6 +1090,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) else sb->s_d_op = &ovl_dentry_operations; + err = -ENOMEM; ufs->creator_cred = cred = prepare_creds(); if (!cred) goto out_put_indexdir; |