Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.com>2018-07-06 08:03:09 -0500
committerGoldwyn Rodrigues <rgoldwyn@suse.com>2018-07-06 08:03:18 -0500
commit68e8fc58db5d3c0406f3618d6f9abed8f41b53f9 (patch)
tree67b5acf9a212bb66cac947b431f4b20d80891332
parentf056b3daebb473ef55c242fc282b4f2ff76afd04 (diff)
ovl: fix random return value on mount (bsc#1099993).
-rw-r--r--patches.fixes/ovl-fix-random-return-value-on-mount.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.fixes/ovl-fix-random-return-value-on-mount.patch b/patches.fixes/ovl-fix-random-return-value-on-mount.patch
new file mode 100644
index 0000000000..6812348a1c
--- /dev/null
+++ b/patches.fixes/ovl-fix-random-return-value-on-mount.patch
@@ -0,0 +1,43 @@
+From: Amir Goldstein <amir73il@gmail.com>
+Date: Tue, 11 Jul 2017 15:58:35 +0300
+Subject: [PATCH] ovl: fix random return value on mount
+References: bsc#1099993
+Git-commit: 8fc646b44385ff0a9853f6590497e43049eeb311
+Patch-mainline: v4.13-rc2
+
+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>
+Acked-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
+
+---
+ fs/overlayfs/super.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
+index f85e73f49543..6a06c35d6e86 100644
+--- a/fs/overlayfs/super.c
++++ b/fs/overlayfs/super.c
+@@ -1182,11 +1182,11 @@ 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 = prepare_creds();
+ if (!ufs->creator_cred)
+ goto out_put_lower_mnt;
+
+- err = -ENOMEM;
+ oe = ovl_alloc_entry(numlower);
+ if (!oe)
+ goto out_put_cred;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index c7af66834b..5136285873 100644
--- a/series.conf
+++ b/series.conf
@@ -8020,6 +8020,7 @@
patches.fixes/ovl-override-creds-with-the-ones-from-the-superblock.patch
patches.fixes/ovl-fix-uid-gid-when-creating-over-whiteout.patch
+ patches.fixes/ovl-fix-random-return-value-on-mount.patch
########################################################
#