CVEs on sumo branch
RFC 1/1 CVEs on sumo branch
I'm sure this has been discussed recently but I wanted to raise this question one more time as I have seen a lot of CVEs patches getting pulled into the sumo branch recently.
We started enabling the cve-check feature and are triaging the results of CVE reports. We think that the following CVEs need attention and need to be pulled into the sumo branch.
There are two approaches to solve this problem:
1. upgrade these packages to the respective versions:
CVE-2018-13785: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=3b847972b8c6135a695b4a16c836ad2dd1cbb350
CVE-2018-8740: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a6646df0cab4bd191974fde33ed8a87b9720557e
CVE-2017-15874: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=29108755c1c5a23855ab4dda59ea728781b9d75e
CVE-2017-14501: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=381f016dccb78a8cf52ffde05459ff084b2f15fd
CVE-2018-11237: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=fb535ac046697db5923575bb23ee419fe7cfbab2
CVE-2017-7960: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=26d1f906258e1d5a933830ee0e4f051d29ee7585
2. Apply the attached patches to sumo branch.
We'd like to hear the community opinion.
Sinan
From e486e61f26c9d0fd2851a2b1056071b34be65e7d Mon Sep 17 00:00:00 2001
From: Changqing Li <[email protected]>
Date: Tue, 28 Aug 2018 17:39:23 +0800
Subject: [PATCH 1/6] libcroco: patch for CVE-2017-7960
--- .../libcroco/libcroco/CVE-2017-7960.patch | 56 +++++++++++++++++++ .../libcroco/libcroco_0.6.12.bb | 2 + 2 files changed, 58 insertions(+) create mode 100644 meta/recipes-support/libcroco/libcroco/CVE-2017-7960.patch
meta/recipes-support/libcroco/libcroco/CVE-2017-7960.patch new file +56 -0
@@ -0,0 +1,56 @@ +input: check end of input before reading a byte + +When reading bytes we weren't check that the index wasn't +out of bound and this could produce an invalid read which +could deal to a security bug. + +Upstream-Status: Backport[https://gitlab.gnome.org/GNOME/libcroco/ + commit/898e3a8c8c0314d2e6b106809a8e3e93cf9d4394] + +CVE: CVE-2017-7960 + +Signed-off-by: Changqing Li <[email protected]> + +diff --git a/src/cr-input.c b/src/cr-input.c +index 49000b1f5f07fe057135f1b8fc69bdcf9613e300..3b63a88ee3b1c56778e58172d147d958951bf099 100644 +--- a/src/cr-input.c ++++ b/src/cr-input.c +@@ -256,7 +256,7 @@ cr_input_new_from_uri (const gchar * a_file_uri, enum CREncoding a_enc) + *we should free buf here because it's own by CRInput. + *(see the last parameter of cr_input_new_from_buf(). + */ +- buf = NULL ; ++ buf = NULL; + } + + cleanup: +@@ -404,6 +404,8 @@ cr_input_get_nb_bytes_left (CRInput const * a_this) + enum CRStatus + cr_input_read_byte (CRInput * a_this, guchar * a_byte) + { ++ gulong nb_bytes_left = 0; ++ + g_return_val_if_fail (a_this && PRIVATE (a_this) + && a_byte, CR_BAD_PARAM_ERROR); + +@@ -413,6 +415,12 @@ cr_input_read_byte (CRInput * a_this, guchar * a_byte) + if (PRIVATE (a_this)->end_of_input == TRUE) + return CR_END_OF_INPUT_ERROR; + ++ nb_bytes_left = cr_input_get_nb_bytes_left (a_this); ++ ++ if (nb_bytes_left < 1) { ++ return CR_END_OF_INPUT_ERROR; ++ } ++ + *a_byte = PRIVATE (a_this)->in_buf[PRIVATE (a_this)->next_byte_index]; + + if (PRIVATE (a_this)->nb_bytes - +@@ -477,7 +485,6 @@ cr_input_read_char (CRInput * a_this, guint32 * a_char) + if (*a_char == '\n') { + PRIVATE (a_this)->end_of_line = TRUE; + } +- + } + + return status;
meta/recipes-support/libcroco/libcroco_0.6.12.bb +2 -0
@@ -16,5 +16,7 @@ BINCONFIG = "${bindir}/croco-0.6-config" inherit gnomebase gtk-doc binconfig-disabled +SRC_URI += "file://CVE-2017-7960.patch" + SRC_URI[archive.md5sum] = "bc0984fce078ba2ce29f9500c6b9ddce" SRC_URI[archive.sha256sum] = "ddc4b5546c9fb4280a5017e2707fbd4839034ed1aba5b7d4372212f34f84f860"
Signature · 1 line
2.19.0
From 297a200543cafe043b870c668acd14b2e21381fd Mon Sep 17 00:00:00 2001
From: Zheng Ruoqin <[email protected]>
Date: Tue, 26 Jun 2018 13:44:17 +0800
Subject: [PATCH 2/6] glibc: fix CVE-2018-11237
glibc: fix CVE-2018-11237
--- .../glibc/glibc/CVE-2018-11237.patch | 82 +++++++++++++++++++ meta/recipes-core/glibc/glibc_2.27.bb | 1 + 2 files changed, 83 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/CVE-2018-11237.patch
meta/recipes-core/glibc/glibc/CVE-2018-11237.patch new file +82 -0
82 lines not on this page · raw message
meta/recipes-core/glibc/glibc_2.27.bb +1 -0
@@ -47,6 +47,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0030-plural_c_no_preprocessor_lines.patch \ file://CVE-2017-18269.patch \ file://CVE-2018-11236.patch \ + file://CVE-2018-11237.patch \ " NATIVESDKFIXES ?= ""
Signature · 1 line
2.19.0
From 78f85abbc1f3fc9ae3a7276706edd94b83bb18a5 Mon Sep 17 00:00:00 2001
From: Jagadeesh Krishnanjanappa <[email protected]>
Date: Mon, 27 Aug 2018 22:43:19 +0530
Subject: [PATCH 3/6] libarchive: CVE-2017-14501
iso9660: validate directory record length
Affects libarchive <= 3.3.2
--- .../libarchive/CVE-2017-14501.patch | 79 +++++++++++++++++++ .../libarchive/libarchive_3.3.2.bb | 1 + 2 files changed, 80 insertions(+) create mode 100644 meta/recipes-extended/libarchive/libarchive/CVE-2017-14501.patch
meta/recipes-extended/libarchive/libarchive/CVE-2017-14501.patch new file +79 -0
79 lines not on this page · raw message
meta/recipes-extended/libarchive/libarchive_3.3.2.bb +1 -0
@@ -37,6 +37,7 @@ SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ file://CVE-2017-14502.patch \ file://non-recursive-extract-and-list.patch \ file://CVE-2017-14503.patch \ + file://CVE-2017-14501.patch \ " SRC_URI[md5sum] = "4583bd6b2ebf7e0e8963d90879eb1b27"
Signature · 1 line
2.19.0
From 57e4d8316c0c7a96913002cc78c2c4a1244919ad Mon Sep 17 00:00:00 2001
From: Sinan Kaya <[email protected]>
Date: Fri, 21 Sep 2018 04:20:44 +0000
Subject: [PATCH 4/6] busybox: CVE-2017-15874
Description:
Heap overflow in decompress_unlzma
https://nvd.nist.gov/vuln/detail/CVE-2017-15874
Fixed-by:
From: Andrej Valek <[email protected]>
Subject: [PATCH] unlzma: fix another SEGV case
Backported to yocto baseline.
--- .../busybox/busybox/CVE-2017-15874.patch | 28 +++++++++++++++++++ meta/recipes-core/busybox/busybox_1.27.2.bb | 1 + 2 files changed, 29 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/CVE-2017-15874.patch
meta/recipes-core/busybox/busybox/CVE-2017-15874.patch new file +28 -0
@@ -0,0 +1,28 @@ +From e75c01bb3249df16201b482b79bb24bec3b58188 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko <[email protected]> +Date: Fri, 27 Oct 2017 15:37:03 +0200 +Subject: [PATCH] unlzma: fix SEGV, closes 10436 + +Signed-off-by: Denys Vlasenko <[email protected]> +--- + archival/libarchive/decompress_unlzma.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/archival/libarchive/decompress_unlzma.c b/archival/libarchive/decompress_unlzma.c +index 29eee2a..41e492f 100644 +--- a/archival/libarchive/decompress_unlzma.c ++++ b/archival/libarchive/decompress_unlzma.c +@@ -353,6 +353,10 @@ unpack_lzma_stream(transformer_state_t *xstate) + pos = buffer_pos - rep0; + if ((int32_t)pos < 0) { + pos += header.dict_size; ++ /* bug 10436 has an example file where this triggers: */ ++ if ((int32_t)pos < 0) ++ goto bad; ++ + /* see unzip_bad_lzma_2.zip: */ + if (pos >= buffer_size) + goto bad; +-- +2.19.0 +
meta/recipes-core/busybox/busybox_1.27.2.bb +1 -0
@@ -47,6 +47,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://busybox-CVE-2017-16544.patch \ file://busybox-fix-lzma-segfaults.patch \ file://umount-ignore-c.patch \ + file://CVE-2017-15874.patch \ " SRC_URI_append_libc-musl = " file://musl.cfg "
Signature · 1 line
2.19.0
From 7ef747575350a70f8429f3094f3962bd0ed3b857 Mon Sep 17 00:00:00 2001
From: Sinan Kaya <[email protected]>
Date: Fri, 21 Sep 2018 05:26:21 +0000
Subject: [PATCH 5/6] libpng: CVE-2018-13785
Cherry-pick upstream patch:
https://github.com/glennrp/libpng/commit/8a05766cb74af05c04c53e6c9d60c13fc4d59bf2
Description of the vulnerability:
https://nvd.nist.gov/vuln/detail/CVE-2018-13785
--- .../libpng/files/CVE-2018-13785.patch | 35 +++++++++++++++++++ .../libpng/libpng_1.6.34.bb | 4 ++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-multimedia/libpng/files/CVE-2018-13785.patch
meta/recipes-multimedia/libpng/files/CVE-2018-13785.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 8a05766cb74af05c04c53e6c9d60c13fc4d59bf2 Mon Sep 17 00:00:00 2001 +From: Cosmin Truta <[email protected]> +Date: Sun, 17 Jun 2018 22:56:29 -0400 +Subject: [PATCH] [libpng16] Fix the calculation of row_factor in + png_check_chunk_length + +(Bug report by Thuan Pham, SourceForge issue #278) +--- + pngrutil.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/pngrutil.c b/pngrutil.c +index 95571b517..5ba995abf 100644 +--- a/pngrutil.c ++++ b/pngrutil.c +@@ -3167,10 +3167,13 @@ png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length) + { + png_alloc_size_t idat_limit = PNG_UINT_31_MAX; + size_t row_factor = +- (png_ptr->width * png_ptr->channels * (png_ptr->bit_depth > 8? 2: 1) +- + 1 + (png_ptr->interlaced? 6: 0)); ++ (size_t)png_ptr->width ++ * (size_t)png_ptr->channels ++ * (png_ptr->bit_depth > 8? 2: 1) ++ + 1 ++ + (png_ptr->interlaced? 6: 0); + if (png_ptr->height > PNG_UINT_32_MAX/row_factor) +- idat_limit=PNG_UINT_31_MAX; ++ idat_limit = PNG_UINT_31_MAX; + else + idat_limit = png_ptr->height * row_factor; + row_factor = row_factor > 32566? 32566 : row_factor; +-- +2.19.0 +
meta/recipes-multimedia/libpng/libpng_1.6.34.bb +3 -1
@@ -8,7 +8,9 @@ DEPENDS = "zlib" LIBV = "16" -SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}${LIBV}/${PV}/${BP}.tar.xz" +SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}${LIBV}/${PV}/${BP}.tar.xz \ + file://CVE-2018-13785.patch \ +" SRC_URI[md5sum] = "c05b6ca7190a5e387b78657dbe5536b2" SRC_URI[sha256sum] = "2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6"
Signature · 1 line
2.19.0
From 68326fcd58249202c6c67a25bc47acdc4034bfb4 Mon Sep 17 00:00:00 2001
From: Sinan Kaya <[email protected]>
Date: Fri, 21 Sep 2018 16:45:30 +0000
Subject: [PATCH 6/6] sqlite3: CVE-2018-13785
port from:
https://www.sqlite.org/cgi/src/vdiff?from=1774f1c3baf0bc3d&to=d75e67654aa9620b&diff=1&w
CVE detail:
https://nvd.nist.gov/vuln/detail/CVE-2018-8740
--- .../sqlite/files/CVE-2018-8740.patch | 52 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.22.0.bb | 1 + 2 files changed, 53 insertions(+) create mode 100644 meta/recipes-support/sqlite/files/CVE-2018-8740.patch
meta/recipes-support/sqlite/files/CVE-2018-8740.patch new file +52 -0
52 lines not on this page · raw message
meta/recipes-support/sqlite/sqlite3_3.22.0.bb +1 -0
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=786d3dc581eff03f4fd9e4a77ed0 SRC_URI = "\ http://www.sqlite.org/2018/sqlite-autoconf-${SQLITE_PV}.tar.gz \ + file://CVE-2018-8740.patch \ " SRC_URI[md5sum] = "96b5648d542e8afa6ab7ffb8db8ddc3d" SRC_URI[sha256sum] = "2824ab1238b706bc66127320afbdffb096361130e23291f26928a027b885c612"
Signature · 1 line
2.19.0
2018-09-21 21:43 GMT+02:00 Sinan Kaya <[email protected]>:
Quoted 3 lines
2. Apply the attached patches to sumo branch.
We'd like to hear the community opinion.
For stable branches the yocto project tends to be on the conservative side. Which means option 2: backport the cve fixes.
For the master branch, version upgrades are preferable, unless a pre-release freeze is in effect.
Alex
Sinan,
Quoted 11 lines · Sinan Kaya
I'm sure this has been discussed recently but I wanted to raise this question
one more time as I have seen a lot of CVEs patches getting pulled into the sumo
branch recently.We started enabling the cve-check feature and are triaging the results of CVE
reports. We think that the following CVEs need attention and need to be pulled
into the sumo branch.
Nice to see another user of this tool.
Quoted 4 lines
There are two approaches to solve this problem:
1. upgrade these packages to the respective versions:
Quoted 12 lines
CVE-2018-13785:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=3b847972b8c6135a695b4a16c836ad2dd1cbb350
CVE-2018-8740:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a6646df0cab4bd191974fde33ed8a87b9720557e
CVE-2017-15874:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=29108755c1c5a23855ab4dda59ea728781b9d75e
CVE-2017-14501:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=381f016dccb78a8cf52ffde05459ff084b2f15fd
CVE-2018-11237:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=fb535ac046697db5923575bb23ee419fe7cfbab2
CVE-2017-7960:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=26d1f906258e1d5a933830ee0e4f051d29ee7585
Typically we do not upgrade packages in stable unless the upgrade is a bug fix only and it does not break things and it is at the desecration of the stable branch maintainer.
Quoted 2 lines
2. Apply the attached patches to sumo branch.
I already have in my sumo-next
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=stable/sumo-next
libcroco: patch for CVE-2017-7960
<http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=stable/sumo-nmut&id=c02364a464d2e96ca663018d5266c68751f2c335>
libarchive: CVE-2017-14501
<http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=stable/sumo-nmut&id=8d7f5e76cad2127e477056ce42d1be06b4df5b5c>
For the rest can you sent them to the proper mailing list [email protected] via git send-patch.
I noticed a few of the patches for recipes need some addition information:
please review
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
In general, we need to make sure Master is not affected before I can take them into Sumo.
Thank you for backporting fixes.
regards,
Armin
Quoted 8 lines
We'd like to hear the community opinion.
Sinan
Quoted 9 lines · On 9/21/2018 4:35 PM, akuster808 wrote:
For the rest can you sent them to the proper mailing list [email protected] via git send-patch.
I noticed a few of the patches for recipes need some addition information:
please review
https://www.openembedded.org/wiki/Commit_Patch_Message_GuidelinesIn general, we need to make sure Master is not affected before I can take them into Sumo.
Sure, I'll work on it. I'm fairly new to working with the yocto upstream.
Quoted 10 lines · On 9/21/2018 4:35 PM, akuster808 wrote:
I already have in my sumo-next
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=stable/sumo-next
libcroco: patch for CVE-2017-7960
<http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=stable/sumo-nmut&id=c02364a464d2e96ca663018d5266c68751f2c335>libarchive: CVE-2017-14501
<http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=stable/sumo-nmut&id=8d7f5e76cad2127e477056ce42d1be06b4df5b5c>For the rest can you sent them to the proper mailing list [email protected] via git send-patch.
Actually, I took this from open-embedded master branch.
https://github.com/openembedded/openembedded-core/commit/b9b254da08c1db94ac9ded5f67d7e2e82e3b9be7
commit b9b254da08c1db94ac9ded5f67d7e2e82e3b9be7
Author: Zheng Ruoqin <[email protected]> Date: Tue Jun 26 13:44:17 2018 +0800
glibc: fix CVE-2018-11237
glibc: fix CVE-2018-11237
What does it take to move this in the right direction?
I'll take care of the remaining 3.
Quoted 24 lines · Sinan Kaya
Quoted 7 lines · On 9/21/2018 4:35 PM, akuster808 wrote:
I already have in my sumo-next
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=stable/sumo-nextlibcroco: patch for CVE-2017-7960
<http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=stable/sumo-nmut&id=c02364a464d2e96ca663018d5266c68751f2c335>Quoted 6 lines
libarchive: CVE-2017-14501
<http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=stable/sumo-nmut&id=8d7f5e76cad2127e477056ce42d1be06b4df5b5c>For the rest can you sent them to the proper mailing list [email protected] via git send-patch.
Actually, I took this from open-embedded master branch.
https://github.com/openembedded/openembedded-core/commit/b9b254da08c1db94ac9ded5f67d7e2e82e3b9be7
commit
b9b254da08c1db94ac9ded5f67d7e2e82e3b9be7
Author: Zheng Ruoqin <[email protected]> Date: Tue Jun 26 13:44:17 2018 +0800
Quoted 8 lines
glibc: fix CVE-2018-11237
glibc: fix CVE-2018-11237
Signed-off-by Zheng Ruoqin <[email protected]>Signed-off-by Richard Purdie <[email protected]>What does it take to move this in the right direction?
bring it to my attention like you have.
backported it for the next build round.
Thanks,
Armin
Quoted 2 lines
I'll take care of the remaining 3.
Quoted 7 lines · akuster
Quoted 4 lines
Signed-off-by Zheng Ruoqin<[email protected]>Signed-off-by Richard Purdie<[email protected]>What does it take to move this in the right direction?
bring it to my attention like you have.
backported it for the next build round.
Here is another one.
https://patches.openembedded.org/patch/154290/
I'll post
gnupg: CVE-2018-9234
shortly.
Quoted 3 lines · Sinan Kaya
Here is another one.
I see you pulled this into rucko-nmut. It is also needed for the sumo branch.