Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1696297 > unrolled thread

[PATCH 4.9 118/125] ovl: fix random return value on mount

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-07-25 22:20 +0200
Last post2017-07-25 22:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.9 118/125] ovl: fix random return value on mount Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200

#1696297 — [PATCH 4.9 118/125] ovl: fix random return value on mount

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-07-25 22:20 +0200
Subject[PATCH 4.9 118/125] ovl: fix random return value on mount
Message-ID<u7ete-7sJ-69@gated-at.bofh.it>
4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Amir Goldstein <amir73il@gmail.com>

commit 8fc646b44385ff0a9853f6590497e43049eeb311 upstream.

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 ...")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/overlayfs/super.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1310,6 +1310,7 @@ static int ovl_fill_super(struct super_b
 	else
 		sb->s_d_op = &ovl_dentry_operations;
 
+	err = -ENOMEM;
 	ufs->creator_cred = cred = prepare_creds();
 	if (!cred)
 		goto out_put_lower_mnt;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web