summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHitendra Prajapati <hprajapati@mvista.com>2022-05-23 22:19:26 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-28 10:38:17 +0100
commitce9e354ebdde10aed4c4e9998659ae54b7a44f6c (patch)
tree5a576873fad2366f3a53d03e2eb4057839408c45 /meta
parent8d27f1fea95b2b07edaa01970aa3ebd57541e896 (diff)
downloadpoky-ce9e354ebdde10aed4c4e9998659ae54b7a44f6c.tar.gz
pcre2: CVE-2022-1586 Out-of-bounds read
Backport from https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a CVE-2022-1586: pcre2: Out-of-bounds read in compile_xclass_matchingpath in pcre2_jit_compile.c. (From OE-Core rev: fb6c980105ffd0262517299ab366218c61cc0665) Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com> (cherry picked from commit 7519eb1cb624bb576cfe60f7470d40c566818ac3) Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch58
-rw-r--r--meta/recipes-support/libpcre/libpcre2_10.39.bb5
2 files changed, 61 insertions, 2 deletions
diff --git a/meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch b/meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch
new file mode 100644
index 0000000000..10d88d7b73
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch
@@ -0,0 +1,58 @@
1From e881ed5028622959cf8859c053501fb1b16387f1 Mon Sep 17 00:00:00 2001
2From: Hitendra Prajapati <hprajapati@mvista.com>
3Date: Mon, 23 May 2022 13:52:39 +0530
4Subject: [PATCH] CVE-2022-1586
5
6Upstream-Status: Backport from https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a
7
8Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
9---
10 ChangeLog | 3 +++
11 src/pcre2_jit_compile.c | 2 +-
12 src/pcre2_jit_test.c | 3 +++
13 3 files changed, 7 insertions(+), 1 deletion(-)
14
15diff --git a/ChangeLog b/ChangeLog
16index d27542d..cd3da65 100644
17--- a/ChangeLog
18+++ b/ChangeLog
19@@ -63,6 +63,9 @@ Version 10.39 29-October-2021
20
21 Reformat slightly to make it C89 compatible again.
22
23+23. Fixed a unicode properrty matching issue in JIT. The character was not
24+fully read in caseless matching.
25+
26
27 Version 10.38 01-October-2021
28 -----------------------------
29diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
30index db2ce65..5baca9b 100644
31--- a/src/pcre2_jit_compile.c
32+++ b/src/pcre2_jit_compile.c
33@@ -7473,7 +7473,7 @@ while (*cc != XCL_END)
34 {
35 SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
36 cc++;
37- if (*cc == PT_CLIST)
38+ if (*cc == PT_CLIST && *cc == XCL_PROP)
39 {
40 other_cases = PRIV(ucd_caseless_sets) + cc[1];
41 while (*other_cases != NOTACHAR)
42diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c
43index 8dee16e..7bb307e 100644
44--- a/src/pcre2_jit_test.c
45+++ b/src/pcre2_jit_test.c
46@@ -412,6 +412,9 @@ static struct regression_test_case regression_test_cases[] = {
47 { MUP, A, 0, 0 | F_PROPERTY, "[\\P{L&}]{2}[^\xc2\x85-\xc2\x89\\p{Ll}\\p{Lu}]{2}", "\xc3\xa9\xe6\x92\xad.a\xe6\x92\xad|\xc2\x8a#" },
48 { PCRE2_UCP, 0, 0, 0 | F_PROPERTY, "[a-b\\s]{2,5}[^a]", "AB baaa" },
49 { MUP, 0, 0, 0 | F_NOMATCH, "[^\\p{Hangul}\\p{Z}]", " " },
50+ { MUP, 0, 0, 0, "[\\p{Lu}\\P{Latin}]+", "c\xEA\xA4\xAE,A,b" },
51+ { MUP, 0, 0, 0, "[\\x{a92e}\\p{Lu}\\P{Latin}]+", "c\xEA\xA4\xAE,A,b" },
52+ { CMUP, 0, 0, 0, "[^S]\\B", "\xe2\x80\x8a" },
53
54 /* Possible empty brackets. */
55 { MU, A, 0, 0, "(?:|ab||bc|a)+d", "abcxabcabd" },
56--
572.35.3
58
diff --git a/meta/recipes-support/libpcre/libpcre2_10.39.bb b/meta/recipes-support/libpcre/libpcre2_10.39.bb
index b5ec62fe18..36c51d700a 100644
--- a/meta/recipes-support/libpcre/libpcre2_10.39.bb
+++ b/meta/recipes-support/libpcre/libpcre2_10.39.bb
@@ -10,8 +10,9 @@ SECTION = "devel"
10LICENSE = "BSD-3-Clause" 10LICENSE = "BSD-3-Clause"
11LIC_FILES_CHKSUM = "file://LICENCE;md5=43cfa999260dd853cd6cb174dc396f3d" 11LIC_FILES_CHKSUM = "file://LICENCE;md5=43cfa999260dd853cd6cb174dc396f3d"
12 12
13SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${PV}/pcre2-${PV}.tar.bz2" 13SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \
14 14 file://CVE-2022-1586.patch \
15"
15UPSTREAM_CHECK_URI = "https://github.com/PhilipHazel/pcre2/releases" 16UPSTREAM_CHECK_URI = "https://github.com/PhilipHazel/pcre2/releases"
16 17
17SRC_URI[sha256sum] = "0f03caf57f81d9ff362ac28cd389c055ec2bf0678d277349a1a4bee00ad6d440" 18SRC_URI[sha256sum] = "0f03caf57f81d9ff362ac28cd389c055ec2bf0678d277349a1a4bee00ad6d440"