]> code.ossystems Code Review - openembedded-core.git/commitdiff
perl: fix CVE-2021-36770
authorKai Kang <kai.kang@windriver.com>
Fri, 10 Sep 2021 05:58:28 +0000 (13:58 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 11 Sep 2021 21:36:27 +0000 (22:36 +0100)
Backport patch to fix CVE-2021-36770. And drop the section of code which
updates version.

CVE: CVE-2021-36770

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/perl/files/CVE-2021-36770.patch [new file with mode: 0644]
meta/recipes-devtools/perl/perl_5.34.0.bb

diff --git a/meta/recipes-devtools/perl/files/CVE-2021-36770.patch b/meta/recipes-devtools/perl/files/CVE-2021-36770.patch
new file mode 100644 (file)
index 0000000..1ef548b
--- /dev/null
@@ -0,0 +1,40 @@
+Backport patch to fix CVE-2021-36770. And drop the section of code which
+updates version.
+
+Upstream-Status: Backport [https://github.com/Perl/perl5/commit/c1a937f]
+CVE: CVE-2021-36770
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+From c1a937fef07c061600a0078f4cb53fe9c2136bb9 Mon Sep 17 00:00:00 2001
+From: Ricardo Signes <rjbs@semiotic.systems>
+Date: Mon, 9 Aug 2021 08:14:05 -0400
+Subject: [PATCH] Encode.pm: apply a local patch for CVE-2021-36770
+
+I expect Encode to see a new release today.
+
+Without this fix, Encode::ConfigLocal can be loaded from a path relative
+to the current directory, because the || operator will evaluate @INC in
+scalar context, putting an integer as the only value in @INC.
+---
+ cpan/Encode/Encode.pm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm
+index a56a99947f..b96a850416 100644
+--- a/cpan/Encode/Encode.pm
++++ b/cpan/Encode/Encode.pm
+@@ -65,8 +66,8 @@ require Encode::Config;
+ eval {
+     local $SIG{__DIE__};
+     local $SIG{__WARN__};
+-    local @INC = @INC || ();
+-    pop @INC if $INC[-1] eq '.';
++    local @INC = @INC;
++    pop @INC if @INC && $INC[-1] eq '.';
+     require Encode::ConfigLocal;
+ };
+-- 
+2.33.0
+
index ab19a8d0be09b0240fffae4a1e35e3a735fa60ae..0e0fe7f98547e4dd11dcb83f93608a11f206bf61 100644 (file)
@@ -17,6 +17,7 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
            file://perl-dynloader.patch \
            file://0002-Constant-Fix-up-shebang.patch \
            file://determinism.patch \
+           file://CVE-2021-36770.patch \
            "
 SRC_URI:append:class-native = " \
            file://perl-configpm-switch.patch \