From patchwork Wed Nov 13 15:19:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 179317 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp9747468ilf; Wed, 13 Nov 2019 07:23:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxaOMkxBTkJeCx+yeo9fdfTH0/iXtb3HRYBCwH/EJjEZi0lwJj7nl7ZWkvq4F5zJYrJbZgQ X-Received: by 2002:a17:90a:19dc:: with SMTP id 28mr5866697pjj.32.1573658612898; Wed, 13 Nov 2019 07:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573658612; cv=none; d=google.com; s=arc-20160816; b=gash1krvE1S6WxQCoRNGAJ1Fi0kGSH9ItiG0Wc49KQiPx1AazyItAf0kOWcNINo2X/ f+ymgxh6ocgkPIdlmBePQ0r3Q08oJ/huHALeaeXll8c2YA2pNRLktyMSRnfE6UWCZpMX KEMRmYKEZJVkT2X/U4wL+Z1NHQOJ09LRd/yW50dccvarQueruKMeH6j1GK/tqvy1DHvw n2wvgoNZJ4ZRZ4d15z/V830Huw3RFfMb0YaVGSnNzzPhFKKjapCJtDfs0roAjSaFBQ35 ssuhJoCS+GvlZkRAr4VH+ka8N7hhEYZMMfxBA4LTCiF+2lBqbqvDb2winLVNybsCzmbF RMtw== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=puhiBPP5B7VdQUEY4ezx23KiQg3zmWvlFzO8o52cArw=; b=w2IQenlj9zDYjEQ26iC2vRzR4LGs7CxiZSskIGWvinCqCb3nmmd8NXR5zDCnF/+C55 iblp7Y/JDmK8cOxLM3Zq26dGTauLdlPR52MB5VhVauG7LzufRDIYjidc3FmJGNWvXAA2 9gcBqGpQM+GimpX4jXNmGS8awDy0Qen7msBDQt/yUEuZmIyK2V9LlwkiKk6NPyBmTwbD f+RFkE1AqOKmwThYLdkyFWx9vWUhseEj+R5BELFg6/Z0e/n+AQ0QwttvOtyJuSTajKI0 9DCVdTp4/MErVRrce1A+St3CWk/HuLdDgRglRrePGFSBagNXLBKCeZd1yLuBip1oAaBs 3Clw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="G5ru/4tU"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id z5si3229995pgc.162.2019.11.13.07.23.32; Wed, 13 Nov 2019 07:23:32 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="G5ru/4tU"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id C6E597F89E; Wed, 13 Nov 2019 15:20:36 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mail.openembedded.org (Postfix) with ESMTP id 3C69A7F7C9 for ; Wed, 13 Nov 2019 15:20:10 +0000 (UTC) Received: by mail-pf1-f178.google.com with SMTP id q13so1877563pff.2 for ; Wed, 13 Nov 2019 07:20:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=JMwubMdWpFifMzl89mTTlj/8AHwkDlvQW6SDTDOW4/s=; b=G5ru/4tUAVGyw7AWWB7FV4KB4ifQoWcgm0CSin57MF9BtMRLV8SB3QP5s3PC2y5vd4 PkARZLDun4S+Z7hRBwShZHWFNe/i7ICgXPuWvcWuFWC4P1W9ySVFwIVl5hHvJ6oUaggU FJgpBuBp4kDsnyw+kPnNDW4QXJ7IiBTu0SHF0nDwdvyxzv1WFEWUe3LYdyg7g4bH6kRo NPrF8fhXZSDQd+FkvpB5xtDWdvihGl6/LrK9BH9TwsOafa/H879wovp6Ig4roDcU71Js vu8b00UwAs3w3rU+ggfV+XSjijOjUkBnwC7WFxz0kujZEDvGuTU8ETXiItpuwa0nQTw+ AZcw== 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:in-reply-to :references; bh=JMwubMdWpFifMzl89mTTlj/8AHwkDlvQW6SDTDOW4/s=; b=jHaW6zSnNcJlDjY2M9T3ro6b9zRE4/BiQWC7F4dIyXcUp5ojXXBrE64GdhQxO7r5Wt 7AFVlXvc9V9JvpM1y6iMCMNpmbcSn57MEzwVyuXUBQ5cPbiee3kvGe0trt0vUlkfqBoi YZ3U0UbAmvHoYm5zMCzKoBMccT9gnoiOqJWYnWgDW5za8ybCbj+zTiDuPD3hAQmd9wsZ aqzBVA3z8AQSMa4e0K1qRZoUhk0SKuZxSL6w6EXGEFLVkeGyJ/mu7ApoKi2Y+unu3SnV FSgguoie5/2cIdL7EqRasy+OEIJH5DRbIsO3StQXR+3VGtLwveuB5RBO/lZOM0RGy1fV aoYQ== X-Gm-Message-State: APjAAAWBkVyPGbx11nNHlGdamLh9iY7atG7ZFU/F6EO2PpZhBkro23rQ ESTgOpVFNWKp+SjpwLB4Zv1WZbtX X-Received: by 2002:a17:90a:d155:: with SMTP id t21mr5492679pjw.84.1573658410923; Wed, 13 Nov 2019 07:20:10 -0800 (PST) Received: from akuster-ThinkPad-T460s.mvista.com ([2601:202:4180:a5c0:2cf9:53ea:e6ab:d378]) by smtp.gmail.com with ESMTPSA id t8sm2622242pjr.25.2019.11.13.07.20.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Nov 2019 07:20:10 -0800 (PST) From: Armin Kuster To: openembedded-core@lists.openembedded.org Date: Wed, 13 Nov 2019 07:19:28 -0800 Message-Id: <0a1b1e88b936177344392e185fbd077622d88b3e.1573658232.git.akuster808@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [OE-core] [warrior 25/25] file: fix CVE-2019-18218 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 From: Ross Burton Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Signed-off-by: Armin Kuster --- .../file/file/CVE-2019-18218.patch | 55 ++++++++++++++++++++++ meta/recipes-devtools/file/file_5.36.bb | 3 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/file/file/CVE-2019-18218.patch -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/file/file/CVE-2019-18218.patch b/meta/recipes-devtools/file/file/CVE-2019-18218.patch new file mode 100644 index 0000000..3d02c5a --- /dev/null +++ b/meta/recipes-devtools/file/file/CVE-2019-18218.patch @@ -0,0 +1,55 @@ +cdf_read_property_info in cdf.c in file through 5.37 does not restrict the +number of CDF_VECTOR elements, which allows a heap-based buffer overflow (4-byte +out-of-bounds write). + +CVE: CVE-2019-18218 +Upstream-Status: Backport +Signed-off-by: Ross Burton + +From 46a8443f76cec4b41ec736eca396984c74664f84 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Mon, 26 Aug 2019 14:31:39 +0000 +Subject: [PATCH] Limit the number of elements in a vector (found by oss-fuzz) + +--- + src/cdf.c | 9 ++++----- + src/cdf.h | 1 + + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/cdf.c b/src/cdf.c +index 9d6396742..bb81d6374 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -1016,8 +1016,9 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, + goto out; + } + nelements = CDF_GETUINT32(q, 1); +- if (nelements == 0) { +- DPRINTF(("CDF_VECTOR with nelements == 0\n")); ++ if (nelements > CDF_ELEMENT_LIMIT || nelements == 0) { ++ DPRINTF(("CDF_VECTOR with nelements == %" ++ SIZE_T_FORMAT "u\n", nelements)); + goto out; + } + slen = 2; +@@ -1060,8 +1061,6 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, + goto out; + inp += nelem; + } +- DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n", +- nelements)); + for (j = 0; j < nelements && i < sh.sh_properties; + j++, i++) + { +diff --git a/src/cdf.h b/src/cdf.h +index 2f7e554b7..05056668f 100644 +--- a/src/cdf.h ++++ b/src/cdf.h +@@ -48,6 +48,7 @@ + typedef int32_t cdf_secid_t; + + #define CDF_LOOP_LIMIT 10000 ++#define CDF_ELEMENT_LIMIT 100000 + + #define CDF_SECID_NULL 0 + #define CDF_SECID_FREE -1 diff --git a/meta/recipes-devtools/file/file_5.36.bb b/meta/recipes-devtools/file/file_5.36.bb index 1a81fde..f169671 100644 --- a/meta/recipes-devtools/file/file_5.36.bb +++ b/meta/recipes-devtools/file/file_5.36.bb @@ -14,7 +14,8 @@ DEPENDS_class-native = "zlib-native" # Blacklist a bogus tag in upstream check UPSTREAM_CHECK_GITTAGREGEX = "FILE(?P(?!6_23).+)" -SRC_URI = "git://github.com/file/file.git" +SRC_URI = "git://github.com/file/file.git \ + file://CVE-2019-18218.patch" SRCREV = "f3a4b9ada3ca99e62c62b9aa78eee4935a8094fe" S = "${WORKDIR}/git"