diff options
| -rw-r--r-- | meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch | 75 | ||||
| -rw-r--r-- | meta/recipes-support/libpcre/libpcre2_10.40.bb | 1 |
2 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch b/meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch new file mode 100644 index 0000000000..833348cdf1 --- /dev/null +++ b/meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | From 94e1c001761373b7d9450768aa15d04c25547a35 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Philip Hazel <Philip.Hazel@gmail.com> | ||
| 3 | Date: Tue, 16 Aug 2022 17:00:45 +0100 | ||
| 4 | Subject: [PATCH] Diagnose negative repeat value in pcre2test subject line | ||
| 5 | |||
| 6 | CVE: CVE-2022-41409 | ||
| 7 | Upstream-Status: Backport [https://github.com/PCRE2Project/pcre2/commit/94e1c001761373b7d9450768aa15d04c25547a35] | ||
| 8 | |||
| 9 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 10 | |||
| 11 | --- | ||
| 12 | ChangeLog | 3 +++ | ||
| 13 | src/pcre2test.c | 4 ++-- | ||
| 14 | testdata/testinput2 | 3 +++ | ||
| 15 | testdata/testoutput2 | 4 ++++ | ||
| 16 | 4 files changed, 12 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/ChangeLog b/ChangeLog | ||
| 19 | index eab50eb7..276eb57a 100644 | ||
| 20 | --- a/ChangeLog | ||
| 21 | +++ b/ChangeLog | ||
| 22 | index eab50eb7..276eb57a 100644 | ||
| 23 | @@ -1,6 +1,9 @@ | ||
| 24 | Change Log for PCRE2 | ||
| 25 | -------------------- | ||
| 26 | |||
| 27 | +20. A negative repeat value in a pcre2test subject line was not being | ||
| 28 | +diagnosed, leading to infinite looping. | ||
| 29 | + | ||
| 30 | |||
| 31 | Version 10.40 15-April-2022 | ||
| 32 | --------------------------- | ||
| 33 | diff --git a/src/pcre2test.c b/src/pcre2test.c | ||
| 34 | index 08f86096..f6f5d66c 100644 | ||
| 35 | --- a/src/pcre2test.c | ||
| 36 | +++ b/src/pcre2test.c | ||
| 37 | @@ -6781,9 +6781,9 @@ while ((c = *p++) != 0) | ||
| 38 | } | ||
| 39 | |||
| 40 | i = (int32_t)li; | ||
| 41 | - if (i-- == 0) | ||
| 42 | + if (i-- <= 0) | ||
| 43 | { | ||
| 44 | - fprintf(outfile, "** Zero repeat not allowed\n"); | ||
| 45 | + fprintf(outfile, "** Zero or negative repeat not allowed\n"); | ||
| 46 | return PR_OK; | ||
| 47 | } | ||
| 48 | |||
| 49 | diff --git a/testdata/testinput2 b/testdata/testinput2 | ||
| 50 | index d37d8f30..717ba2ae 100644 | ||
| 51 | --- a/testdata/testinput2 | ||
| 52 | +++ b/testdata/testinput2 | ||
| 53 | @@ -5932,4 +5932,7 @@ a)"xI | ||
| 54 | /[Aa]{2,3}/BI | ||
| 55 | aabcd | ||
| 56 | |||
| 57 | +-- | ||
| 58 | + \[X]{-10} | ||
| 59 | + | ||
| 60 | # End of testinput2 | ||
| 61 | diff --git a/testdata/testoutput2 b/testdata/testoutput2 | ||
| 62 | index ce090f8c..d2188d3c 100644 | ||
| 63 | --- a/testdata/testoutput2 | ||
| 64 | +++ b/testdata/testoutput2 | ||
| 65 | @@ -17746,6 +17746,10 @@ Subject length lower bound = 2 | ||
| 66 | aabcd | ||
| 67 | 0: aa | ||
| 68 | |||
| 69 | +-- | ||
| 70 | + \[X]{-10} | ||
| 71 | +** Zero or negative repeat not allowed | ||
| 72 | + | ||
| 73 | # End of testinput2 | ||
| 74 | Error -70: PCRE2_ERROR_BADDATA (unknown error number) | ||
| 75 | Error -62: bad serialized data | ||
diff --git a/meta/recipes-support/libpcre/libpcre2_10.40.bb b/meta/recipes-support/libpcre/libpcre2_10.40.bb index 3843d43b69..74c12ecec2 100644 --- a/meta/recipes-support/libpcre/libpcre2_10.40.bb +++ b/meta/recipes-support/libpcre/libpcre2_10.40.bb | |||
| @@ -11,6 +11,7 @@ LICENSE = "BSD-3-Clause" | |||
| 11 | LIC_FILES_CHKSUM = "file://LICENCE;md5=41bfb977e4933c506588724ce69bf5d2" | 11 | LIC_FILES_CHKSUM = "file://LICENCE;md5=41bfb977e4933c506588724ce69bf5d2" |
| 12 | 12 | ||
| 13 | SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \ | 13 | SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \ |
| 14 | file://CVE-2022-41409.patch \ | ||
| 14 | " | 15 | " |
| 15 | UPSTREAM_CHECK_URI = "https://github.com/PhilipHazel/pcre2/releases" | 16 | UPSTREAM_CHECK_URI = "https://github.com/PhilipHazel/pcre2/releases" |
| 16 | 17 | ||
