diff options
| author | Steve Sakoman <steve@sakoman.com> | 2022-01-31 07:08:36 -1000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-16 09:48:51 +0000 |
| commit | 5eab654048d219426f88d20896935454b40c9cf2 (patch) | |
| tree | 7f4622f4de4246bd64b00285ed54a11585ba7e3e /meta/recipes-core | |
| parent | b03d18892cdd59418bebcf9f7f7a3d12815beb76 (diff) | |
| download | poky-5eab654048d219426f88d20896935454b40c9cf2.tar.gz | |
expat: fix CVE-2022-23852
Expat (aka libexpat) before 2.4.4 has a signed integer overflow in XML_GetBuffer
for configurations with a nonzero XML_CONTEXT_BYTES.
Backport patch from:
https://github.com/libexpat/libexpat/commit/847a645152f5ebc10ac63b74b604d0c1a79fae40
CVE: CVE-2022-23852
(From OE-Core rev: 37b618d44ebd965ba17bb61ddf6428cdaea876e5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
| -rw-r--r-- | meta/recipes-core/expat/expat/CVE-2022-23852.patch | 33 | ||||
| -rw-r--r-- | meta/recipes-core/expat/expat_2.2.9.bb | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-core/expat/expat/CVE-2022-23852.patch b/meta/recipes-core/expat/expat/CVE-2022-23852.patch new file mode 100644 index 0000000000..41425c108b --- /dev/null +++ b/meta/recipes-core/expat/expat/CVE-2022-23852.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From 847a645152f5ebc10ac63b74b604d0c1a79fae40 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Samanta Navarro <ferivoz@riseup.net> | ||
| 3 | Date: Sat, 22 Jan 2022 17:48:00 +0100 | ||
| 4 | Subject: [PATCH] lib: Detect and prevent integer overflow in XML_GetBuffer | ||
| 5 | (CVE-2022-23852) | ||
| 6 | |||
| 7 | Upstream-Status: Backport: | ||
| 8 | https://github.com/libexpat/libexpat/commit/847a645152f5ebc10ac63b74b604d0c1a79fae40 | ||
| 9 | |||
| 10 | CVE: CVE-2022-23852 | ||
| 11 | |||
| 12 | Signed-off-by: Steve Sakoman <steve@sakoman.com> | ||
| 13 | |||
| 14 | --- | ||
| 15 | expat/lib/xmlparse.c | 5 +++++ | ||
| 16 | 1 file changed, 5 insertions(+) | ||
| 17 | |||
| 18 | diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c | ||
| 19 | index d54af683..5ce31402 100644 | ||
| 20 | --- a/lib/xmlparse.c | ||
| 21 | +++ b/lib/xmlparse.c | ||
| 22 | @@ -2067,6 +2067,11 @@ XML_GetBuffer(XML_Parser parser, int len) { | ||
| 23 | keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer); | ||
| 24 | if (keep > XML_CONTEXT_BYTES) | ||
| 25 | keep = XML_CONTEXT_BYTES; | ||
| 26 | + /* Detect and prevent integer overflow */ | ||
| 27 | + if (keep > INT_MAX - neededSize) { | ||
| 28 | + parser->m_errorCode = XML_ERROR_NO_MEMORY; | ||
| 29 | + return NULL; | ||
| 30 | + } | ||
| 31 | neededSize += keep; | ||
| 32 | #endif /* defined XML_CONTEXT_BYTES */ | ||
| 33 | if (neededSize | ||
diff --git a/meta/recipes-core/expat/expat_2.2.9.bb b/meta/recipes-core/expat/expat_2.2.9.bb index 757c18c5fa..6a6d5c066f 100644 --- a/meta/recipes-core/expat/expat_2.2.9.bb +++ b/meta/recipes-core/expat/expat_2.2.9.bb | |||
| @@ -11,6 +11,7 @@ SRC_URI = "git://github.com/libexpat/libexpat.git;protocol=https;branch=master \ | |||
| 11 | file://CVE-2021-45960.patch \ | 11 | file://CVE-2021-45960.patch \ |
| 12 | file://CVE-2021-46143.patch \ | 12 | file://CVE-2021-46143.patch \ |
| 13 | file://CVE-2022-22822-27.patch \ | 13 | file://CVE-2022-22822-27.patch \ |
| 14 | file://CVE-2022-23852.patch \ | ||
| 14 | file://libtool-tag.patch \ | 15 | file://libtool-tag.patch \ |
| 15 | " | 16 | " |
| 16 | 17 | ||
