diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2018-09-25 16:23:57 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-25 23:15:49 +0100 |
commit | e3bca3c8d06b7debdfa9472474beb5f475eb5e59 (patch) | |
tree | 70573a101b61e37120baf4cdcaedad4ac3929c29 | |
parent | 0e10a37618c089dc472896a0354aec10ee332913 (diff) | |
download | poky-e3bca3c8d06b7debdfa9472474beb5f475eb5e59.tar.gz |
perl: fix race issues for MakeMaker
Fixed a race issue when compile libhtml-parser-perl and others who use MakeMaker:
[snip]
chmod 755 blib/arch/auto/HTML/Parser/Parser.so
chmod 644 "Parser.bs"
[snip]
The rule INST_DYNAMIC removes '.bs' file which are generated by BOOTSTRAP, but
the have no dependencies, so there is a race issue:
BOOTSTRAP:
touch foo.bs
chmod 755 foo.bs
INST_DYNAMIC:
rm -fr foo.bs
The error would happen when INST_DYNAMIC removes foo.bs after BOOTSTRAP touched
it but before chmod on it.
(From OE-Core rev: f33d7124cd07f776e8b05a26703f6d551357ae09)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl-native_5.24.4.bb b/meta/recipes-devtools/perl/perl-native_5.24.4.bb index affc9d5d78..81d3fd4898 100644 --- a/meta/recipes-devtools/perl/perl-native_5.24.4.bb +++ b/meta/recipes-devtools/perl/perl-native_5.24.4.bb | |||
@@ -16,6 +16,7 @@ SRC_URI += "\ | |||
16 | file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \ | 16 | file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \ |
17 | file://0001-Configure-Remove-fstack-protector-strong-for-native-.patch \ | 17 | file://0001-Configure-Remove-fstack-protector-strong-for-native-.patch \ |
18 | file://perl-5.26.1-guard_old_libcrypt_fix.patch \ | 18 | file://perl-5.26.1-guard_old_libcrypt_fix.patch \ |
19 | file://0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch \ | ||
19 | " | 20 | " |
20 | 21 | ||
21 | SRC_URI[md5sum] = "04622bc4d3941dc7eb571c52b7c02993" | 22 | SRC_URI[md5sum] = "04622bc4d3941dc7eb571c52b7c02993" |
diff --git a/meta/recipes-devtools/perl/perl/0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch b/meta/recipes-devtools/perl/perl/0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch new file mode 100644 index 0000000000..a43fbba0b6 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 40702abf3156fa92ef70ee5d445fe52dd6cfbc7d Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Thu, 20 Sep 2018 18:48:48 +0800 | ||
4 | Subject: [PATCH] ExtUtils/MM_Unix.pm: fix race issues | ||
5 | |||
6 | Fixed a race issue when compile libhtml-parser-perl and others who use MakeMaker: | ||
7 | [snip] | ||
8 | chmod 755 blib/arch/auto/HTML/Parser/Parser.so | ||
9 | chmod 644 "Parser.bs" | ||
10 | [snip] | ||
11 | |||
12 | The rule INST_DYNAMIC removes '.bs' file which are generated by BOOTSTRAP, but | ||
13 | the have no dependencies, so there is a race issue: | ||
14 | |||
15 | BOOTSTRAP: | ||
16 | touch foo.bs | ||
17 | chmod 755 foo.bs | ||
18 | |||
19 | INST_DYNAMIC: | ||
20 | rm -fr foo.bs | ||
21 | |||
22 | The error would happen when INST_DYNAMIC removes foo.bs after BOOTSTRAP touched | ||
23 | it but before chmod on it. | ||
24 | |||
25 | Upstream-Status: Backport [https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/44e95e717372abe2b0a6ee55de4b686760b65360] | ||
26 | |||
27 | Note, This is not a real backport, upstream has totally refactored it in one | ||
28 | patch, please see the link above, it's not a good idea to backport such a big | ||
29 | patch, I just referred it to fix the problem in a simple way. I mark it as | ||
30 | backport is because we can drop the patch after upgrade perl to 5.26 or 5.28. | ||
31 | |||
32 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
33 | --- | ||
34 | cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +- | ||
35 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
36 | |||
37 | diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | ||
38 | index 95d9761..9cabe2d 100644 | ||
39 | --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | ||
40 | +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | ||
41 | @@ -933,7 +933,7 @@ OTHERLDFLAGS = '.$ld_opt.$otherldflags.' | ||
42 | INST_DYNAMIC_DEP = '.$inst_dynamic_dep.' | ||
43 | INST_DYNAMIC_FIX = '.$ld_fix.' | ||
44 | |||
45 | -$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) | ||
46 | +$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) $(BOOTSTRAP) | ||
47 | '); | ||
48 | if ($armaybe ne ':'){ | ||
49 | $ldfrom = 'tmp$(LIB_EXT)'; | ||
50 | -- | ||
51 | 2.7.4 | ||
52 | |||
diff --git a/meta/recipes-devtools/perl/perl_5.24.4.bb b/meta/recipes-devtools/perl/perl_5.24.4.bb index 28f1c249dc..cc5aae9fd0 100644 --- a/meta/recipes-devtools/perl/perl_5.24.4.bb +++ b/meta/recipes-devtools/perl/perl_5.24.4.bb | |||
@@ -65,6 +65,7 @@ SRC_URI += " \ | |||
65 | file://perl-test-customized.patch \ | 65 | file://perl-test-customized.patch \ |
66 | file://perl-5.26.1-guard_old_libcrypt_fix.patch \ | 66 | file://perl-5.26.1-guard_old_libcrypt_fix.patch \ |
67 | file://CVE-2018-12015.patch \ | 67 | file://CVE-2018-12015.patch \ |
68 | file://0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch \ | ||
68 | " | 69 | " |
69 | 70 | ||
70 | # Fix test case issues | 71 | # Fix test case issues |