From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- .../better-fix-for-double-free-CVE-2015-3308.patch | 65 +++++++++++++++++++++ .../correct_rpl_gettimeofday_signature.patch | 67 ++++++++++++++++++++++ .../eliminated-double-free-CVE-2015-3308.patch | 33 +++++++++++ 3 files changed, 165 insertions(+) create mode 100644 meta/recipes-support/gnutls/gnutls/better-fix-for-double-free-CVE-2015-3308.patch create mode 100644 meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch create mode 100644 meta/recipes-support/gnutls/gnutls/eliminated-double-free-CVE-2015-3308.patch (limited to 'meta/recipes-support/gnutls/gnutls') diff --git a/meta/recipes-support/gnutls/gnutls/better-fix-for-double-free-CVE-2015-3308.patch b/meta/recipes-support/gnutls/gnutls/better-fix-for-double-free-CVE-2015-3308.patch new file mode 100644 index 0000000000..8824729d2f --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/better-fix-for-double-free-CVE-2015-3308.patch @@ -0,0 +1,65 @@ +From 053ae65403216acdb0a4e78b25ad66ee9f444f02 Mon Sep 17 00:00:00 2001 +From: Nikos Mavrogiannopoulos +Date: Sat, 28 Mar 2015 22:41:03 +0100 +Subject: [PATCH] Better fix for the double free in dist point parsing + +Fixes CVE-2015-3308 +Upstream-Status: Backport + +Signed-off-by: Sona Sarmadi +--- + lib/x509/x509_ext.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c +index 2e69ed0..f974b02 100644 +--- a/lib/x509/x509_ext.c ++++ b/lib/x509/x509_ext.c +@@ -2287,7 +2287,7 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext, + int len, ret; + uint8_t reasons[2]; + unsigned i, type, rflags, j; +- gnutls_datum_t san; ++ gnutls_datum_t san = {NULL, 0}; + + result = asn1_create_element + (_gnutls_get_pkix(), "PKIX1.CRLDistributionPoints", &c2); +@@ -2310,9 +2310,6 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext, + + i = 0; + do { +- san.data = NULL; +- san.size = 0; +- + snprintf(name, sizeof(name), "?%u.reasons", (unsigned)i + 1); + + len = sizeof(reasons); +@@ -2337,6 +2334,9 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext, + + j = 0; + do { ++ san.data = NULL; ++ san.size = 0; ++ + ret = + _gnutls_parse_general_name2(c2, name, j, &san, + &type, 0); +@@ -2351,6 +2351,7 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext, + ret = crl_dist_points_set(cdp, type, &san, rflags); + if (ret < 0) + break; ++ san.data = NULL; /* it is now in cdp */ + + j++; + } while (ret >= 0); +@@ -2360,6 +2361,7 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext, + + if (ret < 0 && ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { + gnutls_assert(); ++ gnutls_free(san.data); + goto cleanup; + } + +-- +1.9.1 + diff --git a/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch b/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch new file mode 100644 index 0000000000..5e452c52e7 --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch @@ -0,0 +1,67 @@ +From ae3370788ed3447bba16969d9eb1bf1b9631e1b7 Mon Sep 17 00:00:00 2001 +From: Valentin Popa +Date: Fri, 25 Apr 2014 13:58:55 +0300 +Subject: [PATCH] Correct rpl_gettimeofday signature + +Currently we fail on uclibc like below + +| In file included from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/procfs.h:32:0, +| from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/ucontext.h:26, +| from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/signal.h:392, +| from ../../gl/signal.h:52, +| from ../../gl/sys/select.h:58, +| from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/types.h:220, +| from ../../gl/sys/types.h:28, +| from ../../lib/includes/gnutls/gnutls.h:46, +| from ex-cxx.cpp:3: +| ../../gl/sys/time.h:396:66: error: conflicting declaration 'void* restrict' +| ../../gl/sys/time.h:396:50: error: 'restrict' has a previous declaration as 'timeval* restrict' +| make[4]: *** [ex-cxx.o] Error 1 +| make[4]: *** Waiting for unfinished jobs.... + +GCC detects that we call 'restrict' as param name in function +signatures and complains since both params are called 'restrict' +therefore we use __restrict to denote the C99 keywork + +This only happens of uclibc since this code is not excercised with +eglibc otherwise we will have same issue there too + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gl/sys_time.in.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h +index 84a17c9..6ceadc3 100644 +--- a/gl/sys_time.in.h ++++ b/gl/sys_time.in.h +@@ -93,20 +93,20 @@ struct timeval + # define gettimeofday rpl_gettimeofday + # endif + _GL_FUNCDECL_RPL (gettimeofday, int, +- (struct timeval *restrict, void *restrict) ++ (struct timeval *__restrict, void *__restrict) + _GL_ARG_NONNULL ((1))); + _GL_CXXALIAS_RPL (gettimeofday, int, +- (struct timeval *restrict, void *restrict)); ++ (struct timeval *__restrict, void *__restrict)); + # else + # if !@HAVE_GETTIMEOFDAY@ + _GL_FUNCDECL_SYS (gettimeofday, int, +- (struct timeval *restrict, void *restrict) ++ (struct timeval *__restrict, void *__restrict) + _GL_ARG_NONNULL ((1))); + # endif + /* Need to cast, because on glibc systems, by default, the second argument is + struct timezone *. */ + _GL_CXXALIAS_SYS_CAST (gettimeofday, int, +- (struct timeval *restrict, void *restrict)); ++ (struct timeval *__restrict, void *__restrict)); + # endif + _GL_CXXALIASWARN (gettimeofday); + #elif defined GNULIB_POSIXCHECK +-- +1.9.1 + diff --git a/meta/recipes-support/gnutls/gnutls/eliminated-double-free-CVE-2015-3308.patch b/meta/recipes-support/gnutls/gnutls/eliminated-double-free-CVE-2015-3308.patch new file mode 100644 index 0000000000..628103ff6b --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/eliminated-double-free-CVE-2015-3308.patch @@ -0,0 +1,33 @@ +From d6972be33264ecc49a86cd0958209cd7363af1e9 Mon Sep 17 00:00:00 2001 +From: Nikos Mavrogiannopoulos +Date: Mon, 23 Mar 2015 22:55:29 +0100 +Subject: [PATCH] eliminated double-free in the parsing of dist points +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Reported by Robert Święcki. + +Fixes CVE-2015-3308 +Upstream-Status: Backport + +Signed-off-by: Sona Sarmadi +--- + lib/x509/x509_ext.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c +index c8d5867..6f09438 100644 +--- a/lib/x509/x509_ext.c ++++ b/lib/x509/x509_ext.c +@@ -2360,7 +2360,6 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext, + + if (ret < 0 && ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { + gnutls_assert(); +- gnutls_free(san.data); + goto cleanup; + } + +-- +1.9.1 + -- cgit v1.2.3-54-g00ecf