From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: In-Reply-To: <20200318132716.10624-5-ada@thorsis.com> MIME-Version: 1.0 Message-Id: From: Michael Olbrich Date: Fri, 27 Mar 2020 10:52:26 +0100 Subject: Re: [ptxdist] [4/4] libxml2: Add upstream patch fixing CVE-2019-20388 List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Alexander Dahl Thanks, applied. Michael [sent from post-receive hook] On Fri, 27 Mar 2020 10:52:26 +0100, Alexander Dahl wrote: > Signed-off-by: Alexander Dahl > --- > ...mory-leak-in-xmlSchemaValidateStream.patch | 29 +++++++++++++++++++ > patches/libxml2-2.9.10/series | 3 +- > 2 files changed, 31 insertions(+), 1 deletion(-) > create mode 100644 patches/libxml2-2.9.10/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch > > diff --git a/patches/libxml2-2.9.10/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch b/patches/libxml2-2.9.10/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch > new file mode 100644 > index 000000000..1ca086217 > --- /dev/null > +++ b/patches/libxml2-2.9.10/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch > @@ -0,0 +1,29 @@ > +From: Zhipeng Xie > +Date: Tue, 20 Aug 2019 16:33:06 +0800 > +Subject: [PATCH] Fix memory leak in xmlSchemaValidateStream > + > +When ctxt->schema is NULL, xmlSchemaSAXPlug->xmlSchemaPreRun > +alloc a new schema for ctxt->schema and set vctxt->xsiAssemble > +to 1. Then xmlSchemaVStart->xmlSchemaPreRun initialize > +vctxt->xsiAssemble to 0 again which cause the alloced schema > +can not be freed anymore. > + > +Found with libFuzzer. > + > +Signed-off-by: Zhipeng Xie > +--- > + xmlschemas.c | 1 - > + 1 file changed, 1 deletion(-) > + > +diff --git a/xmlschemas.c b/xmlschemas.c > +index d19de6df5f50..59495c2738ab 100644 > +--- a/xmlschemas.c > ++++ b/xmlschemas.c > +@@ -28095,7 +28095,6 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { > + vctxt->nberrors = 0; > + vctxt->depth = -1; > + vctxt->skipDepth = -1; > +- vctxt->xsiAssemble = 0; > + vctxt->hasKeyrefs = 0; > + #ifdef ENABLE_IDC_NODE_TABLES_TEST > + vctxt->createIDCNodeTables = 1; > diff --git a/patches/libxml2-2.9.10/series b/patches/libxml2-2.9.10/series > index b8e92fb7a..fed72960d 100644 > --- a/patches/libxml2-2.9.10/series > +++ b/patches/libxml2-2.9.10/series > @@ -2,6 +2,7 @@ > #tag:base --start-number 1 > #tag:upstream --start-number 1 > 0001-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch > +0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch > #tag:ptx --start-number 200 > 0200-xml2-config-is-not-SYSROOT-aware.patch > -# 0a9081f5db07b8cbb593bc669a7603c7 - git-ptx-patches magic > +# d6f49636e8813a3a9e46758f352fc667 - git-ptx-patches magic > _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de