From 8cb87526627b9820a9be5698c084df788a433a7b Mon Sep 17 00:00:00 2001 From: "yanjun.zhu" Date: Fri, 30 Nov 2012 19:23:48 +0800 Subject: Python: Fix for CVE-2012-2135 Reference:http://http://bugs.python.org/issue14579 The utf-16 decoder in Python 3.1 through 3.3 does not update the aligned_end variable after calling the unicode_decode_call_errorhandler function, which allows remote attackers to obtain sensitive information (process memory) or cause a denial of service (memory corruption and crash) via unspecified vectors. http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-2135 [YOCTO #3450] (From OE-Core rev: 11544f573bc94ce69a8a76d645e46ab6359dee78) Signed-off-by: yanjun.zhu Signed-off-by: Richard Purdie --- .../python/python/python-2.7.3-CVE-2012-2135.patch | 24 ++++++++++++++++++++++ meta/recipes-devtools/python/python_2.7.3.bb | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch diff --git a/meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch new file mode 100644 index 0000000000..ad118b04d9 --- /dev/null +++ b/meta/recipes-devtools/python/python/python-2.7.3-CVE-2012-2135.patch @@ -0,0 +1,24 @@ +Upstream-Status: Backport + +Reference:http://bugs.python.org/issue14579 + +The utf-16 decoder in Python 3.1 through 3.3 does not update the +aligned_end variable after calling the unicode_decode_call_errorhandler +function, which allows remote attackers to obtain sensitive information +(process memory) or cause a denial of service (memory corruption and crash) +via unspecified vectors. + +http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-2135 +Signed-off-by: yanjun.zhu +diff -urpN a/Objects/unicodeobject.c b/Objects/unicodeobject.c +--- a/Objects/unicodeobject.c 2012-11-12 16:25:33.000000000 +0800 ++++ b/Objects/unicodeobject.c 2012-11-12 16:26:22.000000000 +0800 +@@ -2568,7 +2568,7 @@ PyUnicode_DecodeUTF16Stateful(const char + } + + /* UTF-16 code pair: */ +- if (q >= e) { ++ if (e - q < 2) { + errmsg = "unexpected end of data"; + startinpos = (((const char *)q)-2)-starts; + endinpos = ((const char *)e)-starts; diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb index 3eb36fc9aa..1968629f11 100644 --- a/meta/recipes-devtools/python/python_2.7.3.bb +++ b/meta/recipes-devtools/python/python_2.7.3.bb @@ -1,6 +1,6 @@ require python.inc DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" -PR = "${INC_PR}.2" +PR = "${INC_PR}.3" DISTRO_SRC_URI ?= "file://sitecustomize.py" DISTRO_SRC_URI_linuxstdbase = "" @@ -27,6 +27,7 @@ SRC_URI += "\ file://avoid_warning_for_sunos_specific_module.patch \ file://python-2.7.3-berkeley-db-5.3.patch \ file://python-2.7.3-remove-bsdb-rpath.patch \ + file://python-2.7.3-CVE-2012-2135.patch \ " S = "${WORKDIR}/Python-${PV}" -- cgit v1.2.3-54-g00ecf