summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQi.Chen@windriver.com <Qi.Chen@windriver.com>2019-08-28 09:48:44 +0800
committerArmin Kuster <akuster808@gmail.com>2019-08-28 08:05:55 -0700
commit10ac9f8bff0cad508404ac22d66132115db02d8b (patch)
tree573e0c78b3c3b842485bf824797d02e15327a470
parentbcbd10be8775785c2d03fc768a1f76a6c13ea8b8 (diff)
downloadmeta-security-10ac9f8bff0cad508404ac22d66132115db02d8b.tar.gz
ecryptfs-utils: fix race condition in do_install
The rootsbindir is a self-defined directory. The install-rootsbinPROGRAMS is actually treated as part of install-data instead of install-exec. Do making install-exec-am depend on it actually results in the following Makefile contents. install-data-am: install-rootsbinPROGRAMS install-exec-am: install-binPROGRAMS install-binSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-exec-hook: install-rootsbinPROGRAMS And this results in race condition as two install commands of the same file running at the same time. Error message is like below. TOPDIR/tmp-glibc/hosttools/install: cannot create regular file 'TOPDIR/tmp-glibc/work/aarch64-wrs-linux/ecryptfs-utils/111-r0/image/sbin/mount.ecryptfs': File exists Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--recipes-security/ecryptfs-utils/ecryptfs-utils_111.bb1
-rw-r--r--recipes-security/ecryptfs-utils/files/0001-avoid-race-condition.patch32
2 files changed, 33 insertions, 0 deletions
diff --git a/recipes-security/ecryptfs-utils/ecryptfs-utils_111.bb b/recipes-security/ecryptfs-utils/ecryptfs-utils_111.bb
index 8e498c9..e45ee0b 100644
--- a/recipes-security/ecryptfs-utils/ecryptfs-utils_111.bb
+++ b/recipes-security/ecryptfs-utils/ecryptfs-utils_111.bb
@@ -14,6 +14,7 @@ DEPENDS = "keyutils libgcrypt intltool-native glib-2.0-native"
14SRC_URI = "\ 14SRC_URI = "\
15 https://launchpad.net/ecryptfs/trunk/${PV}/+download/${BPN}_${PV}.orig.tar.gz \ 15 https://launchpad.net/ecryptfs/trunk/${PV}/+download/${BPN}_${PV}.orig.tar.gz \
16 file://ecryptfs-utils-CVE-2016-6224.patch \ 16 file://ecryptfs-utils-CVE-2016-6224.patch \
17 file://0001-avoid-race-condition.patch \
17 file://ecryptfs.service \ 18 file://ecryptfs.service \
18 " 19 "
19 20
diff --git a/recipes-security/ecryptfs-utils/files/0001-avoid-race-condition.patch b/recipes-security/ecryptfs-utils/files/0001-avoid-race-condition.patch
new file mode 100644
index 0000000..af28d58
--- /dev/null
+++ b/recipes-security/ecryptfs-utils/files/0001-avoid-race-condition.patch
@@ -0,0 +1,32 @@
1From ab671b02e3aaf65dd1fd279789ea933b8140fe52 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 27 Aug 2019 16:08:00 +0800
4Subject: [PATCH] avoid race condition
5
6The rootsbin directory is self defined. The install-rootsbinPROGRAMS
7is actually treated as part of install-data.
8
9This would avoid race condition which causes install failure.
10
11Upstream-Status: Pending
12
13Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14---
15 src/utils/Makefile.am | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
19index 83cf851..344883a 100644
20--- a/src/utils/Makefile.am
21+++ b/src/utils/Makefile.am
22@@ -67,6 +67,6 @@ ecryptfs_stat_LDADD = $(top_builddir)/src/libecryptfs/libecryptfs.la
23 test_SOURCES = test.c io.c
24 test_LDADD = $(top_builddir)/src/libecryptfs/libecryptfs.la
25
26-install-exec-hook: install-rootsbinPROGRAMS
27+install-data-hook: install-rootsbinPROGRAMS
28 -rm -f "$(DESTDIR)/$(rootsbindir)/umount.ecryptfs_private"
29 $(LN_S) "mount.ecryptfs_private" "$(DESTDIR)/$(rootsbindir)/umount.ecryptfs_private"
30--
312.17.1
32