bind: fix CVE-2019-6471 and CVE-2018-5743
PATCH 1/4 bind: fix CVE-2019-6471 and CVE-2018-5743
From: Kai Kang <[email protected]>
Backport patches to fix CVE-2019-6471 and CVE-2018-5743 for bind. CVE-2019-6471 is fixed by 0001-bind-fix-CVE-2019-6471.patch and the other 6 patches are for CVE-2018-5743. And backport one more patch to fix compile error on arm caused by these 6 commits.
(From OE-Core rev: 3c39d4158677b97253df63f23b74c3a9dd5539f6)
--- .../bind/bind/0001-bind-fix-CVE-2019-6471.patch | 64 ++ .../0001-fix-enforcement-of-tcp-clients-v1.patch | 60 ++ ...02-tcp-clients-could-still-be-exceeded-v2.patch | 670 +++++++++++++++ ...-reference-counter-for-pipeline-groups-v3.patch | 278 +++++++ ...uota-accounting-and-client-mortality-chec.patch | 512 ++++++++++++ ...pquota-and-pipeline-refs-allow-special-ca.patch | 911 +++++++++++++++++++++ ...tore-allowance-for-tcp-clients-interfaces.patch | 80 ++ ...mic-operations-in-bin-named-client.c-with.patch | 140 ++++ meta/recipes-connectivity/bind/bind_9.11.5-P4.bb | 8 + 9 files changed, 2723 insertions(+) create mode 100644 meta/recipes-connectivity/bind/bind/0001-bind-fix-CVE-2019-6471.patch create mode 100644 meta/recipes-connectivity/bind/bind/0001-fix-enforcement-of-tcp-clients-v1.patch create mode 100644 meta/recipes-connectivity/bind/bind/0002-tcp-clients-could-still-be-exceeded-v2.patch create mode 100644 meta/recipes-connectivity/bind/bind/0003-use-reference-counter-for-pipeline-groups-v3.patch create mode 100644 meta/recipes-connectivity/bind/bind/0004-better-tcpquota-accounting-and-client-mortality-chec.patch create mode 100644 meta/recipes-connectivity/bind/bind/0005-refactor-tcpquota-and-pipeline-refs-allow-special-ca.patch create mode 100644 meta/recipes-connectivity/bind/bind/0006-restore-allowance-for-tcp-clients-interfaces.patch create mode 100644 meta/recipes-connectivity/bind/bind/0007-Replace-atomic-operations-in-bin-named-client.c-with.patch
meta/recipes-connectivity/bind/bind/0001-bind-fix-CVE-2019-6471.patch new file +64 -0
@@ -0,0 +1,64 @@ +Backport patch to fix CVE-2019-6471. + +Ref: +https://security-tracker.debian.org/tracker/CVE-2019-6471 + +CVE: CVE-2019-6471 +Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/bind9/commit/3a9c7bb] + +Signed-off-by: Kai Kang <[email protected]> + +From 3a9c7bb80d4a609b86427406d9dd783199920b5b Mon Sep 17 00:00:00 2001 +From: Mark Andrews <[email protected]> +Date: Tue, 19 Mar 2019 14:14:21 +1100 +Subject: [PATCH] move item_out test inside lock in dns_dispatch_getnext() + +(cherry picked from commit 60c42f849d520564ed42e5ed0ba46b4b69c07712) +--- + lib/dns/dispatch.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c +index 408beda367..3278db4a07 100644 +--- a/lib/dns/dispatch.c ++++ b/lib/dns/dispatch.c +@@ -134,7 +134,7 @@ struct dns_dispentry { + isc_task_t *task; + isc_taskaction_t action; + void *arg; +- bool item_out; ++ bool item_out; + dispsocket_t *dispsocket; + ISC_LIST(dns_dispatchevent_t) items; + ISC_LINK(dns_dispentry_t) link; +@@ -3422,13 +3422,14 @@ dns_dispatch_getnext(dns_dispentry_t *resp, dns_dispatchevent_t **sockevent) { + disp = resp->disp; + REQUIRE(VALID_DISPATCH(disp)); + +- REQUIRE(resp->item_out == true); +- resp->item_out = false; +- + ev = *sockevent; + *sockevent = NULL; + + LOCK(&disp->lock); ++ ++ REQUIRE(resp->item_out == true); ++ resp->item_out = false; ++ + if (ev->buffer.base != NULL) + free_buffer(disp, ev->buffer.base, ev->buffer.length); + free_devent(disp, ev); +@@ -3573,6 +3574,9 @@ dns_dispatch_removeresponse(dns_dispentry_t **resp, + isc_task_send(disp->task[0], &disp->ctlevent); + } + ++/* ++ * disp must be locked. ++ */ + static void + do_cancel(dns_dispatch_t *disp) { + dns_dispatchevent_t *ev; +-- +2.20.1 +
meta/recipes-connectivity/bind/bind/0001-fix-enforcement-of-tcp-clients-v1.patch new file +60 -0
60 lines not on this page · raw message
meta/recipes-connectivity/bind/bind/0002-tcp-clients-could-still-be-exceeded-v2.patch new file +670 -0
670 lines not on this page · raw message
meta/recipes-connectivity/bind/bind/0003-use-reference-counter-for-pipeline-groups-v3.patch new file +278 -0
278 lines not on this page · raw message
meta/recipes-connectivity/bind/bind/0004-better-tcpquota-accounting-and-client-mortality-chec.patch new file +512 -0
512 lines not on this page · raw message
meta/recipes-connectivity/bind/bind/0005-refactor-tcpquota-and-pipeline-refs-allow-special-ca.patch new file +911 -0
911 lines not on this page · raw message
meta/recipes-connectivity/bind/bind/0006-restore-allowance-for-tcp-clients-interfaces.patch new file +80 -0
80 lines not on this page · raw message
meta/recipes-connectivity/bind/bind/0007-Replace-atomic-operations-in-bin-named-client.c-with.patch new file +140 -0
140 lines not on this page · raw message
meta/recipes-connectivity/bind/bind_9.11.5-P4.bb +8 -0
@@ -20,6 +20,14 @@ SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \ file://0001-configure.in-remove-useless-L-use_openssl-lib.patch \ file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \ file://0001-avoid-start-failure-with-bind-user.patch \ + file://0001-bind-fix-CVE-2019-6471.patch \ + file://0001-fix-enforcement-of-tcp-clients-v1.patch \ + file://0002-tcp-clients-could-still-be-exceeded-v2.patch \ + file://0003-use-reference-counter-for-pipeline-groups-v3.patch \ + file://0004-better-tcpquota-accounting-and-client-mortality-chec.patch \ + file://0005-refactor-tcpquota-and-pipeline-refs-allow-special-ca.patch \ + file://0006-restore-allowance-for-tcp-clients-interfaces.patch \ + file://0007-Replace-atomic-operations-in-bin-named-client.c-with.patch \ " SRC_URI[md5sum] = "8ddab4b61fa4516fe404679c74e37960"
Signature · 1 line
2.7.4
PATCH 2/4 python: fix CVE-2019-16935
From: Chen Qi <[email protected]>
(From OE-Core rev: 1a7593bcdaf8a8cf15259aee8a0e2686247f2987)
--- ...43-Escape-the-server-title-of-DocXMLRPCSe.patch | 101 +++++++++++++++++++++ meta/recipes-devtools/python/python_2.7.16.bb | 1 + 2 files changed, 102 insertions(+) create mode 100644 meta/recipes-devtools/python/python/0001-2.7-bpo-38243-Escape-the-server-title-of-DocXMLRPCSe.patch
meta/recipes-devtools/python/python/0001-2.7-bpo-38243-Escape-the-server-title-of-DocXMLRPCSe.patch new file +101 -0
@@ -0,0 +1,101 @@ +From b161c89c8bd66fe928192e21364678c8e9b8fcc0 Mon Sep 17 00:00:00 2001 +From: Dong-hee Na <[email protected]> +Date: Tue, 1 Oct 2019 19:58:01 +0900 +Subject: [PATCH] [2.7] bpo-38243: Escape the server title of DocXMLRPCServer + (GH-16447) + +Escape the server title of DocXMLRPCServer.DocXMLRPCServer +when rendering the document page as HTML. + +CVE: CVE-2019-16935 + +Upstream-Status: Backport [https://github.com/python/cpython/pull/16447/commits/b41cde823d026f2adc21ef14b1c2e92b1006de06] + +Signed-off-by: Chen Qi <[email protected]> +--- + Lib/DocXMLRPCServer.py | 13 +++++++++++- + Lib/test/test_docxmlrpc.py | 20 +++++++++++++++++++ + .../2019-09-25-13-21-09.bpo-38243.1pfz24.rst | 3 +++ + 3 files changed, 35 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst + +diff --git a/Lib/DocXMLRPCServer.py b/Lib/DocXMLRPCServer.py +index 4064ec2e48..90b037dd35 100644 +--- a/Lib/DocXMLRPCServer.py ++++ b/Lib/DocXMLRPCServer.py +@@ -20,6 +20,16 @@ from SimpleXMLRPCServer import (SimpleXMLRPCServer, + CGIXMLRPCRequestHandler, + resolve_dotted_attribute) + ++ ++def _html_escape_quote(s): ++ s = s.replace("&", "&") # Must be done first! ++ s = s.replace("<", "<") ++ s = s.replace(">", ">") ++ s = s.replace('"', """) ++ s = s.replace('\'', "'") ++ return s ++ ++ + class ServerHTMLDoc(pydoc.HTMLDoc): + """Class used to generate pydoc HTML document for a server""" + +@@ -210,7 +220,8 @@ class XMLRPCDocGenerator: + methods + ) + +- return documenter.page(self.server_title, documentation) ++ title = _html_escape_quote(self.server_title) ++ return documenter.page(title, documentation) + + class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): + """XML-RPC and documentation request handler class. +diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py +index 4dff4159e2..c45b892b8b 100644 +--- a/Lib/test/test_docxmlrpc.py ++++ b/Lib/test/test_docxmlrpc.py +@@ -1,5 +1,6 @@ + from DocXMLRPCServer import DocXMLRPCServer + import httplib ++import re + import sys + from test import test_support + threading = test_support.import_module('threading') +@@ -176,6 +177,25 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase): + self.assertIn("""Try self.<strong>add</strong>, too.""", + response.read()) + ++ def test_server_title_escape(self): ++ """Test that the server title and documentation ++ are escaped for HTML. ++ """ ++ self.serv.set_server_title('test_title<script>') ++ self.serv.set_server_documentation('test_documentation<script>') ++ self.assertEqual('test_title<script>', self.serv.server_title) ++ self.assertEqual('test_documentation<script>', ++ self.serv.server_documentation) ++ ++ generated = self.serv.generate_html_documentation() ++ title = re.search(r'<title>(.+?)</title>', generated).group() ++ documentation = re.search(r'<p><tt>(.+?)</tt></p>', generated).group() ++ self.assertEqual('<title>Python: test_title<script></title>', ++ title) ++ self.assertEqual('<p><tt>test_documentation<script></tt></p>', ++ documentation) ++ ++ + def test_main(): + test_support.run_unittest(DocXMLRPCHTTPGETServer) + +diff --git a/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst b/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst +new file mode 100644 +index 0000000000..8f02baed9e +--- /dev/null ++++ b/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst +@@ -0,0 +1,3 @@ ++Escape the server title of :class:`DocXMLRPCServer.DocXMLRPCServer` ++when rendering the document page as HTML. ++(Contributed by Dong-hee Na in :issue:`38243`.) +-- +2.17.1 +
meta/recipes-devtools/python/python_2.7.16.bb +1 -0
@@ -32,6 +32,7 @@ SRC_URI += " \ file://0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch \ file://0001-2.7-bpo-34155-Dont-parse-domains-containing-GH-13079.patch \ file://bpo-36742-cve-2019-10160.patch \ + file://0001-2.7-bpo-38243-Escape-the-server-title-of-DocXMLRPCSe.patch \ " S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
2.7.4
PATCH 3/4 python: fix CVE-2018-20852
In reply to Armin KusterFrom: Anuj Mittal <[email protected]>
--- meta/recipes-devtools/python/python.inc | 1 + .../python/python/CVE-2018-20852.patch | 123 +++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 meta/recipes-devtools/python/python/CVE-2018-20852.patch
meta/recipes-devtools/python/python.inc +1 -0
@@ -13,6 +13,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://bpo-36216-cve-2019-9636.patch \ file://bpo-36216-cve-2019-9636-fix.patch \ file://CVE-2019-9740.patch \ + file://CVE-2018-20852.patch \ " SRC_URI[md5sum] = "30157d85a2c0479c09ea2cbe61f2aaf5"
meta/recipes-devtools/python/python/CVE-2018-20852.patch new file +123 -0
123 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 4/4 python: update to 2.7.17
In reply to Armin KusterFrom: Alexander Kanavin <[email protected]>
Drop backports, rebase a couple of patches.
This is the second last release of py 2.x; upstream support ends on 1 January 2020, there will be one final 2.x afterwards.
Note that the only thing that still needs python 2.x in oe-core is u-boot; when the next u-boot update arrives, we should find out where the py3 migration is for that component before merging the update.
(From OE-Core rev: 184b60eb905bb75ecc7a0c29a175e624d8555fac)
---
...ative-fix-one-do_populate_sysroot-warning.patch | 25 +--
...on-native_2.7.16.bb => python-native_2.7.17.bb} | 2 +-
meta/recipes-devtools/python/python.inc | 10 +-
...55-Dont-parse-domains-containing-GH-13079.patch | 90 ---------
...43-Escape-the-server-title-of-DocXMLRPCSe.patch | 101 ----------
...thon-Resolve-intermediate-staging-issues.patch} | 53 +++--
.../python/python/CVE-2018-20852.patch | 123 ------------
.../python/python/CVE-2019-9740.patch | 215 ---------------------
.../python/bpo-35907-cve-2019-9948-fix.patch | 55 ------
.../python/python/bpo-35907-cve-2019-9948.patch | 55 ------
.../python/bpo-36216-cve-2019-9636-fix.patch | 28 ---
.../python/python/bpo-36216-cve-2019-9636.patch | 111 -----------
.../python/python/bpo-36742-cve-2019-10160.patch | 81 --------
.../python/{python_2.7.16.bb => python_2.7.17.bb} | 3 -
14 files changed, 49 insertions(+), 903 deletions(-)
rename meta/recipes-devtools/python/{python-native_2.7.16.bb => python-native_2.7.17.bb} (97%)
delete mode 100644 meta/recipes-devtools/python/python/0001-2.7-bpo-34155-Dont-parse-domains-containing-GH-13079.patch
delete mode 100644 meta/recipes-devtools/python/python/0001-2.7-bpo-38243-Escape-the-server-title-of-DocXMLRPCSe.patch
rename meta/recipes-devtools/python/python/{builddir.patch => 0001-python-Resolve-intermediate-staging-issues.patch} (58%)
delete mode 100644 meta/recipes-devtools/python/python/CVE-2018-20852.patch
delete mode 100644 meta/recipes-devtools/python/python/CVE-2019-9740.patch
delete mode 100644 meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948-fix.patch
delete mode 100644 meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948.patch
delete mode 100644 meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636-fix.patch
delete mode 100644 meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636.patch
delete mode 100644 meta/recipes-devtools/python/python/bpo-36742-cve-2019-10160.patch
rename meta/recipes-devtools/python/{python_2.7.16.bb => python_2.7.17.bb} (97%)meta/recipes-devtools/python/python-native/0001-python-native-fix-one-do_populate_sysroot-warning.patch +13 -12
@@ -1,4 +1,4 @@ -From 12292444e1b3662b994bc223d92b8338fb0895ff Mon Sep 17 00:00:00 2001 +From 6cbb7529cf7ff0da3ca649fb3486facd9620d625 Mon Sep 17 00:00:00 2001 From: Changqing Li <[email protected]> Date: Thu, 25 Oct 2018 07:32:14 +0000 Subject: [PATCH] python-native: fix one do_populate_sysroot warning
@@ -17,23 +17,24 @@ when do_populate_sysroot. use append to fix it. Upstream-Status: Inappropriate [oe-specific] Signed-off-by: Changqing Li <[email protected]> + --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py -index 7bf13ed..6c0f29b 100644 +index a2c8127..22f9e23 100644 --- a/setup.py +++ b/setup.py -@@ -40,7 +40,7 @@ def add_dir_to_list(dirlist, dir): - 1) 'dir' is not already in 'dirlist' - 2) 'dir' actually exists, and is a directory.""" - if dir is not None and os.path.isdir(dir) and dir not in dirlist: -- dirlist.insert(0, dir) -+ dirlist.append(dir) - - def macosx_sdk_root(): - """ +@@ -47,7 +47,7 @@ def add_dir_to_list(dirlist, dir): + else: + dir_exists = os.path.isdir(dir) + if dir_exists: +- dirlist.insert(0, dir) ++ dirlist.append(dir) + + MACOS_SDK_ROOT = None + -- -2.18.0 +2.17.1
meta/recipes-devtools/python/python-native_2.7.17.bb renamed from meta/recipes-devtools/python/python-native_2.7.16.bb +1 -1
@@ -12,7 +12,7 @@ SRC_URI += "\ file://nohostlibs.patch \ file://multilib.patch \ file://add-md5module-support.patch \ - file://builddir.patch \ + file://0001-python-Resolve-intermediate-staging-issues.patch \ file://parallel-makeinst-create-bindir.patch \ file://revert_use_of_sysconfigdata.patch \ file://0001-python-native-fix-one-do_populate_sysroot-warning.patch \
meta/recipes-devtools/python/python.inc +2 -8
@@ -8,16 +8,10 @@ INC_PR = "r1" LIC_FILES_CHKSUM = "file://LICENSE;md5=e466242989bd33c1bd2b6a526a742498" SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ - file://bpo-35907-cve-2019-9948.patch \ - file://bpo-35907-cve-2019-9948-fix.patch \ - file://bpo-36216-cve-2019-9636.patch \ - file://bpo-36216-cve-2019-9636-fix.patch \ - file://CVE-2019-9740.patch \ - file://CVE-2018-20852.patch \ " -SRC_URI[md5sum] = "30157d85a2c0479c09ea2cbe61f2aaf5" -SRC_URI[sha256sum] = "f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7" +SRC_URI[md5sum] = "b3b6d2c92f42a60667814358ab9f0cfd" +SRC_URI[sha256sum] = "4d43f033cdbd0aa7b7023c81b0e986fd11e653b5248dac9144d508f11812ba41" # python recipe is actually python 2.x # also, exclude pre-releases for both python 2.x and 3.x
meta/recipes-devtools/python/python/0001-2.7-bpo-34155-Dont-parse-domains-containing-GH-13079.patch deleted +0 -90
90 lines not on this page · raw message
meta/recipes-devtools/python/python/0001-2.7-bpo-38243-Escape-the-server-title-of-DocXMLRPCSe.patch deleted +0 -101
101 lines not on this page · raw message
meta/recipes-devtools/python/python/0001-python-Resolve-intermediate-staging-issues.patch renamed from meta/recipes-devtools/python/python/builddir.patch +33 -20
65 lines not on this page · raw message
meta/recipes-devtools/python/python/CVE-2018-20852.patch deleted +0 -123
123 lines not on this page · raw message
meta/recipes-devtools/python/python/CVE-2019-9740.patch deleted +0 -215
215 lines not on this page · raw message
meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948-fix.patch deleted +0 -55
55 lines not on this page · raw message
meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948.patch deleted +0 -55
55 lines not on this page · raw message
meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636-fix.patch deleted +0 -28
@@ -1,28 +0,0 @@ -From 06b5ee585d6e76bdbb4002f642d864d860cbbd2b Mon Sep 17 00:00:00 2001 -From: Steve Dower <[email protected]> -Date: Tue, 12 Mar 2019 08:23:33 -0700 -Subject: [PATCH] bpo-36216: Only print test messages when verbose - -CVE: CVE-2019-9636 - -Upstream-Status: Backport https://github.com/python/cpython/pull/12291/commits/06b5ee585d6e76bdbb4002f642d864d860cbbd2b - -Signed-off-by: Martin Jansa <[email protected]> ---- - Lib/test/test_urlparse.py | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py -index 73b0228ea8e3..1830d0b28688 100644 ---- a/Lib/test/test_urlparse.py -+++ b/Lib/test/test_urlparse.py -@@ -644,7 +644,8 @@ def test_urlsplit_normalization(self): - for scheme in [u"http", u"https", u"ftp"]: - for c in denorm_chars: - url = u"{}://netloc{}false.netloc/path".format(scheme, c) -- print "Checking %r" % url -+ if test_support.verbose: -+ print "Checking %r" % url - with self.assertRaises(ValueError): - urlparse.urlsplit(url) -
meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636.patch deleted +0 -111
111 lines not on this page · raw message
meta/recipes-devtools/python/python/bpo-36742-cve-2019-10160.patch deleted +0 -81
81 lines not on this page · raw message
meta/recipes-devtools/python/python_2.7.17.bb renamed from meta/recipes-devtools/python/python_2.7.16.bb +0 -3
@@ -30,9 +30,6 @@ SRC_URI += " \ file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \ file://float-endian.patch \ file://0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch \ - file://0001-2.7-bpo-34155-Dont-parse-domains-containing-GH-13079.patch \ - file://bpo-36742-cve-2019-10160.patch \ - file://0001-2.7-bpo-38243-Escape-the-server-title-of-DocXMLRPCSe.patch \ " S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
2.7.4