From patchwork Thu Oct 4 10:04:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 148112 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp743842lji; Thu, 4 Oct 2018 03:05:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV63uQXz/VjhXrZlaV2k4TEi1srHakjhy84F2s+Aq3ub7DVTCs5n4rvEOt3yUA4AM0P/MkTa2 X-Received: by 2002:a63:bd41:: with SMTP id d1-v6mr5045246pgp.309.1538647503285; Thu, 04 Oct 2018 03:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538647503; cv=none; d=google.com; s=arc-20160816; b=SdHNQkFXK1pw81xLeSKyXzuODJ5/5Hh41qLC+w6KiyHnH9EyzftnAPDIuFvc9G5Hkn 6BqTzuAtwA1WfUNaExrKEp6Py0xpQsm1Mx6PlGKaTP3KvhQUt0epsGxUnx5pRmUXiaac mIEJwQsuSh5ruxVRJUXGc9bYC6YPJFC0jRB/C8jN1nMabop2VlSEKDYIxyFaLEdnKI1S AqSfTDYMtwFzPOChyugi323xgS76y0AEDWlUOVvmSz/1GLpERZjagJ5B7UulZheB5Y/G /dlAuW3zzAn6/XPToM0wVPjwS5kmd2HawaPYy8x9zQKUPfw16KGvGqxZMr1J1CsXej6i gVtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=RdaMqu0Z4nRmO09ZZpCEKC9CdEnAYnxELKABv+WCnQ8=; b=iCOZm6eX2kn9380yU5jPOjF5pNVpHz1s0ub+TuemoqN24rjerjaGsueW/EVkdBXg1R 2IfdGHE3d3e1fPPWBM+juzRehA3BYC9v8Vv94igKnRTVfpQ+tuky4ZdOTSdUSf41GxPU ow1QAZ8hwHq6lERBFXb5Nejfc0YFjnMItXxesTixZItyZK1mjnS9ceS4NA+7nVbgu0TI N56Zg2viQX7Tv5HztoOT2LS+71Yc9IWmxROpP5MH63MR5WyeTxU8DZ/DReOtSCfQNeBu oG9IgZUekX/na5kULMelvr40b3DiJbDB05xb5zfLLIXOMSkKH/x6JN0vGgsNQiZkO7o8 BTLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=o+XPrx8F; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id s36-v6si4603430pld.88.2018.10.04.03.05.02; Thu, 04 Oct 2018 03:05:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=o+XPrx8F; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 08CB578A9A; Thu, 4 Oct 2018 10:04:58 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mail.openembedded.org (Postfix) with ESMTP id CC14574A13 for ; Thu, 4 Oct 2018 10:04:55 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id a2-v6so2155774wrc.13 for ; Thu, 04 Oct 2018 03:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=BRzLd+jYLTf0RCvqJpkkaam8Z5M+G9iKo/I/l8ffe3I=; b=o+XPrx8F9fwffvI2V5fb6yO0L1e800Op70cRCQODyZAE1XxS6MCCHcOyg+MU0IL6x5 n6y/doJu0zmTiiRc/XCDC4IXgRY6ze2PhgA9dIg/foBdjbtc2EwDxUzkhCG5Y6gmWKmr dW7ye+vXLazS5FKz5Kw5Mv+FrMB4efJ503Vz2xq4kCA12f3/KaAiPpsYt+oPlKoCHnVQ +z/6B9dzLw/PF4bj0CzsukXN02xQ4aAS8zH6Dwclie94oxGbz9GuSHRY1vVNeeBbTJUj 89hIlLwIanceYlutJ1rf+/XH5NgI2aVusXTRf0MnM5azKENDZIkSATJdjcdu5g6Kvh5W JK1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=BRzLd+jYLTf0RCvqJpkkaam8Z5M+G9iKo/I/l8ffe3I=; b=n/8qhbBST/RvDu7kd/aEbkWCLkanb7G3b4A+yTEuu6VT2NcM3YZlxasGFLNVkN9aV6 TuxVQlGpsHo/rno1uL+uTc481jhEOPhG2QlLhK40nejKYEHNHb0ATFzp9nqrYlfa+bSX BlJJjHYOcndpFxg5/cJdAbZvXdEGvRAprBn0AAFkWMA31702Imc2lsSWksAjtUguHv1P 8mrPIRaw5j3sQ65MoAgPeQJmF5b8IXuBd2gA0LvhBdc6rXeUMFeJhwulujwaEQIyceC4 ovrxgwC20Z9un9MatBj9khSjtUTms61C0rIU6OtDyOw67WA8SLY6ytf/zPBPYUg4DD+V K6VA== X-Gm-Message-State: ABuFfohhm2rLTbtUDzbkeYw9hSHtB2dd3NEr7kktAYSBBsrq4D8NBn9J PDDC2yfD2O6udq35IZmny5Ymwy16sFI= X-Received: by 2002:adf:9b19:: with SMTP id b25-v6mr4303214wrc.35.1538647496046; Thu, 04 Oct 2018 03:04:56 -0700 (PDT) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id k63-v6sm5647850wmd.46.2018.10.04.03.04.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 03:04:55 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 4 Oct 2018 11:04:52 +0100 Message-Id: <20181004100452.9713-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH] libxml2: refresh CVE-2017-8872 X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org The patch associated with the CVE-2017-8872 report was never merged into libxml2, but a slightly different patch for the same problem was. Cherry-pick that as a backport, which also fixes the failing test suite. Signed-off-by: Ross Burton --- .../libxml/libxml2/fix-CVE-2017-8872.patch | 73 +++++++++++++++------- 1 file changed, 50 insertions(+), 23 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch b/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch index b34479f318f..42a4b0ed602 100644 --- a/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch +++ b/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch @@ -1,38 +1,65 @@ -From b4bee17b158e289e5c4c9045e64e5374ccafe068 Mon Sep 17 00:00:00 2001 -From: Salvatore Bonaccorso -Date: Tue, 3 Jul 2018 15:54:03 +0800 -Subject: [PATCH] Out-of-bounds read in htmlParseTryOrFinish (CVE-2017-8872) +Upstream-Status: Backport +CVE: CVE-2017-8872 +Signed-off-by: Ross Burton -https://bugzilla.gnome.org/show_bug.cgi?id=775200 -Fixes bug 775200. +From 123234f2cfcd9e9b9f83047eee1dc17b4c3f4407 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer +Date: Tue, 11 Sep 2018 14:52:07 +0200 +Subject: [PATCH] Free input buffer in xmlHaltParser -Signed-off-by: Salvatore Bonaccorso +This avoids miscalculation of available bytes. -Upstream-Status: Submitted -https://bug775200.bugzilla-attachments.gnome.org/attachment.cgi?id=366193 -CVE: CVE-2017-8872 -Signed-off-by: Hongxu Jia +Thanks to Yunho Kim for the report. + +Closes: #26 --- - parser.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) + parser.c | 5 +++++ + result/errors/759573.xml.err | 17 +++++++---------- + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/parser.c b/parser.c -index ca9fde2..fb4c889 100644 +index ca9fde2c..5813a664 100644 --- a/parser.c +++ b/parser.c -@@ -12464,7 +12464,11 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) { +@@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) { + ctxt->input->free((xmlChar *) ctxt->input->base); + ctxt->input->free = NULL; } ++ if (ctxt->input->buf != NULL) { ++ xmlFreeParserInputBuffer(ctxt->input->buf); ++ ctxt->input->buf = NULL; ++ } ctxt->input->cur = BAD_CAST""; ++ ctxt->input->length = 0; ctxt->input->base = ctxt->input->cur; -- ctxt->input->end = ctxt->input->cur; -+ ctxt->input->end = ctxt->input->cur; -+ if (ctxt->input->buf) -+ xmlBufEmpty (ctxt->input->buf->buffer); -+ else -+ ctxt->input->length = 0; + ctxt->input->end = ctxt->input->cur; } - } +diff --git a/result/errors/759573.xml.err b/result/errors/759573.xml.err +index 554039f6..38ef5c40 100644 +--- a/result/errors/759573.xml.err ++++ b/result/errors/759573.xml.err +@@ -21,14 +21,11 @@ Entity: line 1: + ^ + ./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration +-