diff options
author | Hitendra Prajapati <hprajapati@mvista.com> | 2022-05-23 22:20:06 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-05-28 10:38:20 +0100 |
commit | 475b0d3fad963d5d74f9e3e2eeab853093163565 (patch) | |
tree | 0b5dd275f6b0f1bf8e8df34bea592381be3623f8 | |
parent | 232b5533de22bba7a747f73f684d609e217531f9 (diff) | |
download | poky-475b0d3fad963d5d74f9e3e2eeab853093163565.tar.gz |
pcre2: CVE-2022-1586 Out-of-bounds read
Source: https://github.com/PCRE2Project/pcre2
MR: 118027
Type: Security Fix
Disposition: Backport from https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a
ChangeID: e9b448d96a7e58b34b2c4069757a6f3ca0917713
Description:
CVE-2022-1586: pcre2: Out-of-bounds read in compile_xclass_matchingpath in pcre2_jit_compile.c.
(From OE-Core rev: 7f4daf88b71f486ddc7140500d2b44181a99222f)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
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>
-rw-r--r-- | meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch | 59 | ||||
-rw-r--r-- | meta/recipes-support/libpcre/libpcre2_10.34.bb | 1 |
2 files changed, 60 insertions, 0 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..fbbbc9ca77 --- /dev/null +++ b/meta/recipes-support/libpcre/libpcre2/CVE-2022-1586.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From 233c4248550d0c1d9bfee42198d5ee0855b7d413 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hitendra Prajapati <hprajapati@mvista.com> | ||
3 | Date: Mon, 23 May 2022 13:52:39 +0530 | ||
4 | Subject: [PATCH] CVE-2022-1586 | ||
5 | |||
6 | Upstream-Status: Backport from https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a | ||
7 | |||
8 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
9 | --- | ||
10 | ChangeLog | 3 +++ | ||
11 | src/pcre2_jit_compile.c | 2 +- | ||
12 | src/pcre2_jit_test.c | 4 ++++ | ||
13 | 3 files changed, 8 insertions(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/ChangeLog b/ChangeLog | ||
16 | index 0926c29..b5d72dc 100644 | ||
17 | --- a/ChangeLog | ||
18 | +++ b/ChangeLog | ||
19 | @@ -1,6 +1,9 @@ | ||
20 | Change Log for PCRE2 | ||
21 | -------------------- | ||
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.34 21-November-2019 | ||
28 | ------------------------------ | ||
29 | diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c | ||
30 | index f564127..5d43865 100644 | ||
31 | --- a/src/pcre2_jit_compile.c | ||
32 | +++ b/src/pcre2_jit_compile.c | ||
33 | @@ -7119,7 +7119,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) | ||
42 | diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c | ||
43 | index a9b3880..9df87fd 100644 | ||
44 | --- a/src/pcre2_jit_test.c | ||
45 | +++ b/src/pcre2_jit_test.c | ||
46 | @@ -408,6 +408,10 @@ static struct regression_test_case regression_test_cases[] = { | ||
47 | { MUP, A, 0, 0 | F_PROPERTY, "[\xc3\xa2-\xc3\xa6\xc3\x81-\xc3\x84\xe2\x80\xa8-\xe2\x80\xa9\xe6\x92\xad\\p{Zs}]{2,}", "\xe2\x80\xa7\xe2\x80\xa9\xe6\x92\xad \xe6\x92\xae" }, | ||
48 | { 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#" }, | ||
49 | { PCRE2_UCP, 0, 0, 0 | F_PROPERTY, "[a-b\\s]{2,5}[^a]", "AB baaa" }, | ||
50 | + { MUP, 0, 0, 0 | F_NOMATCH, "[^\\p{Hangul}\\p{Z}]", " " }, | ||
51 | + { MUP, 0, 0, 0, "[\\p{Lu}\\P{Latin}]+", "c\xEA\xA4\xAE,A,b" }, | ||
52 | + { MUP, 0, 0, 0, "[\\x{a92e}\\p{Lu}\\P{Latin}]+", "c\xEA\xA4\xAE,A,b" }, | ||
53 | + { CMUP, 0, 0, 0, "[^S]\\B", "\xe2\x80\x8a" }, | ||
54 | |||
55 | /* Possible empty brackets. */ | ||
56 | { MU, A, 0, 0, "(?:|ab||bc|a)+d", "abcxabcabd" }, | ||
57 | -- | ||
58 | 2.25.1 | ||
59 | |||
diff --git a/meta/recipes-support/libpcre/libpcre2_10.34.bb b/meta/recipes-support/libpcre/libpcre2_10.34.bb index f2c36944d8..213b946a54 100644 --- a/meta/recipes-support/libpcre/libpcre2_10.34.bb +++ b/meta/recipes-support/libpcre/libpcre2_10.34.bb | |||
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=b1588d3bb4cb0e1f5a597d908f8c5b37" | |||
12 | 12 | ||
13 | SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/pcre2-${PV}.tar.bz2 \ | 13 | SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/pcre2-${PV}.tar.bz2 \ |
14 | file://pcre-cross.patch \ | 14 | file://pcre-cross.patch \ |
15 | file://CVE-2022-1586.patch \ | ||
15 | " | 16 | " |
16 | 17 | ||
17 | SRC_URI[md5sum] = "d280b62ded13f9ccf2fac16ee5286366" | 18 | SRC_URI[md5sum] = "d280b62ded13f9ccf2fac16ee5286366" |