diff options
| author | Archana Polampalli <archana.polampalli@windriver.com> | 2024-09-09 06:55:59 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-09-16 06:09:56 -0700 |
| commit | 00fb236b77e000b48e268bb0b22613cf524fd2c6 (patch) | |
| tree | bc8e3d4245eafa731e251ba880b788c10492985c | |
| parent | 0a757026035905cfecac210f65abda0aad8c48ee (diff) | |
| download | poky-00fb236b77e000b48e268bb0b22613cf524fd2c6.tar.gz | |
expat: fix CVE-2024-45492
An issue was discovered in libexpat before 2.6.3. nextScaffoldPart in xmlparse.c can have
an integer overflow for m_groupSize on 32-bit platforms (where UINT_MAX equals SIZE_MAX).
(From OE-Core rev: 5b31e7f46ab05aca48f4fb11c558ff990e772c9e)
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-core/expat/expat/CVE-2024-45492.patch | 38 | ||||
| -rw-r--r-- | meta/recipes-core/expat/expat_2.5.0.bb | 1 |
2 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-core/expat/expat/CVE-2024-45492.patch b/meta/recipes-core/expat/expat/CVE-2024-45492.patch new file mode 100644 index 0000000000..a569f18067 --- /dev/null +++ b/meta/recipes-core/expat/expat/CVE-2024-45492.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From 9b0615959a4df00b4719c5beae286eb52fd32fe0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Sebastian Pipping <sebastian@pipping.org> | ||
| 3 | Date: Mon, 19 Aug 2024 22:37:16 +0200 | ||
| 4 | Subject: [PATCH] lib: Detect integer overflow in function nextScaffoldPart | ||
| 5 | |||
| 6 | Reported by TaiYou | ||
| 7 | |||
| 8 | CVE: CVE-2024-45492 | ||
| 9 | |||
| 10 | Upstream-Status: Backport [https://github.com/libexpat/libexpat/pull/892/commits/9bf0f2c16ee86f64] | ||
| 11 | |||
| 12 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
| 13 | --- | ||
| 14 | lib/xmlparse.c | 9 +++++++++ | ||
| 15 | 1 file changed, 9 insertions(+) | ||
| 16 | |||
| 17 | diff --git a/lib/xmlparse.c b/lib/xmlparse.c | ||
| 18 | index adb27e3..6d7e92f 100644 | ||
| 19 | --- a/lib/xmlparse.c | ||
| 20 | +++ b/lib/xmlparse.c | ||
| 21 | @@ -7465,6 +7465,15 @@ nextScaffoldPart(XML_Parser parser) { | ||
| 22 | int next; | ||
| 23 | |||
| 24 | if (! dtd->scaffIndex) { | ||
| 25 | + /* Detect and prevent integer overflow. | ||
| 26 | + * The preprocessor guard addresses the "always false" warning | ||
| 27 | + * from -Wtype-limits on platforms where | ||
| 28 | + * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */ | ||
| 29 | +#if UINT_MAX >= SIZE_MAX | ||
| 30 | + if (parser->m_groupSize > ((size_t)(-1) / sizeof(int))) { | ||
| 31 | + return -1; | ||
| 32 | + } | ||
| 33 | +#endif | ||
| 34 | dtd->scaffIndex = (int *)MALLOC(parser, parser->m_groupSize * sizeof(int)); | ||
| 35 | if (! dtd->scaffIndex) | ||
| 36 | return -1; | ||
| 37 | -- | ||
| 38 | 2.40.0 | ||
diff --git a/meta/recipes-core/expat/expat_2.5.0.bb b/meta/recipes-core/expat/expat_2.5.0.bb index f670f94685..26190383e3 100644 --- a/meta/recipes-core/expat/expat_2.5.0.bb +++ b/meta/recipes-core/expat/expat_2.5.0.bb | |||
| @@ -27,6 +27,7 @@ SRC_URI = "https://github.com/libexpat/libexpat/releases/download/R_${VERSION_TA | |||
| 27 | file://CVE-2024-45490-0003.patch \ | 27 | file://CVE-2024-45490-0003.patch \ |
| 28 | file://CVE-2024-45490-0004.patch \ | 28 | file://CVE-2024-45490-0004.patch \ |
| 29 | file://CVE-2024-45491.patch \ | 29 | file://CVE-2024-45491.patch \ |
| 30 | file://CVE-2024-45492.patch \ | ||
| 30 | " | 31 | " |
| 31 | 32 | ||
| 32 | UPSTREAM_CHECK_URI = "https://github.com/libexpat/libexpat/releases/" | 33 | UPSTREAM_CHECK_URI = "https://github.com/libexpat/libexpat/releases/" |
