summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei.gherzan@huawei.com>2022-07-11 20:53:05 +0200
committerBruce Ashfield <bruce.ashfield@gmail.com>2022-07-15 17:11:58 -0400
commit81d62914ce2ec9ea6096ee097b6e48d332672b3c (patch)
tree9c47697d4ff958a49eea4b77ba37d5e14faae2a7
parentcf8a763b28e0608b475643781c5ae51a5186b543 (diff)
downloadmeta-virtualization-81d62914ce2ec9ea6096ee097b6e48d332672b3c.tar.gz
fuse-overlayfs: Fix buffer overflow bug on workdir path
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-extended/fuse-overlayfs/fuse-overlayfs/0001-Fix-buffer-overflow-on-workdir-path.patch32
-rw-r--r--recipes-extended/fuse-overlayfs/fuse-overlayfs_0.6.4.bb5
2 files changed, 36 insertions, 1 deletions
diff --git a/recipes-extended/fuse-overlayfs/fuse-overlayfs/0001-Fix-buffer-overflow-on-workdir-path.patch b/recipes-extended/fuse-overlayfs/fuse-overlayfs/0001-Fix-buffer-overflow-on-workdir-path.patch
new file mode 100644
index 00000000..129423d4
--- /dev/null
+++ b/recipes-extended/fuse-overlayfs/fuse-overlayfs/0001-Fix-buffer-overflow-on-workdir-path.patch
@@ -0,0 +1,32 @@
1From 7e5992d6121aed0cfcbfaf70472f28d87cff1426 Mon Sep 17 00:00:00 2001
2From: Andrei Gherzan <andrei.gherzan@huawei.com>
3Date: Mon, 11 Jul 2022 20:36:06 +0200
4Subject: [PATCH] Fix buffer overflow on workdir path
5
6We make sure that the path used for workdir is reallocated before
7appending. This was initially included in upstream as part of
8https://github.com/containers/fuse-overlayfs/commit/d5b725b6f18a437db66bfc1456d04c3bf658f66a.
9
10Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
11Upstream-Status: Backport
12---
13 main.c | 3 +++
14 1 file changed, 3 insertions(+)
15
16diff --git a/main.c b/main.c
17index e5bdda1..118a6cb 100644
18--- a/main.c
19+++ b/main.c
20@@ -5039,6 +5039,9 @@ main (int argc, char *argv[])
21 if (path == NULL)
22 goto err_out1;
23 mkdir (path, 0700);
24+ path = realloc(path, strlen(path)+strlen("/work")+1);
25+ if (!path)
26+ error (EXIT_FAILURE, errno, "allocating workdir path");
27 strcat (path, "/work");
28 mkdir (path, 0700);
29 free (lo.workdir);
30--
312.25.1
32
diff --git a/recipes-extended/fuse-overlayfs/fuse-overlayfs_0.6.4.bb b/recipes-extended/fuse-overlayfs/fuse-overlayfs_0.6.4.bb
index a02c1e60..4f793bd9 100644
--- a/recipes-extended/fuse-overlayfs/fuse-overlayfs_0.6.4.bb
+++ b/recipes-extended/fuse-overlayfs/fuse-overlayfs_0.6.4.bb
@@ -6,7 +6,10 @@ LICENSE = "GPL-3.0-or-later"
6LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" 6LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
7 7
8SRCREV = "098d9ad79fdbb8538adde08628408aa32a8b4b17" 8SRCREV = "098d9ad79fdbb8538adde08628408aa32a8b4b17"
9SRC_URI = "git://github.com/containers/fuse-overlayfs.git;nobranch=1;protocol=https" 9SRC_URI = " \
10 git://github.com/containers/fuse-overlayfs.git;nobranch=1;protocol=https \
11 file://0001-Fix-buffer-overflow-on-workdir-path.patch \
12"
10 13
11DEPENDS = "fuse3" 14DEPENDS = "fuse3"
12 15