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 --- meta/recipes-support/gnutls/gnutls.inc | 49 ++++++++++++++++ .../better-fix-for-double-free-CVE-2015-3308.patch | 65 +++++++++++++++++++++ .../correct_rpl_gettimeofday_signature.patch | 67 ++++++++++++++++++++++ .../eliminated-double-free-CVE-2015-3308.patch | 33 +++++++++++ meta/recipes-support/gnutls/gnutls_3.3.5.bb | 9 +++ .../gnutls/libtasn1/dont-depend-on-help2man.patch | 14 +++++ .../gnutls/libtasn1/libtasn1-CVE-2015-3622.patch | 44 ++++++++++++++ .../libtasn1/libtasn1_fix_for_automake_1.12.patch | 28 +++++++++ meta/recipes-support/gnutls/libtasn1_4.0.bb | 22 +++++++ 9 files changed, 331 insertions(+) create mode 100644 meta/recipes-support/gnutls/gnutls.inc 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 create mode 100644 meta/recipes-support/gnutls/gnutls_3.3.5.bb create mode 100644 meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch create mode 100644 meta/recipes-support/gnutls/libtasn1/libtasn1-CVE-2015-3622.patch create mode 100644 meta/recipes-support/gnutls/libtasn1/libtasn1_fix_for_automake_1.12.patch create mode 100644 meta/recipes-support/gnutls/libtasn1_4.0.bb (limited to 'meta/recipes-support/gnutls') diff --git a/meta/recipes-support/gnutls/gnutls.inc b/meta/recipes-support/gnutls/gnutls.inc new file mode 100644 index 0000000000..12b26cc97d --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls.inc @@ -0,0 +1,49 @@ +SUMMARY = "GNU Transport Layer Security Library" +HOMEPAGE = "http://www.gnu.org/software/gnutls/" +BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls" +DEPENDS = "zlib nettle" + +LICENSE = "GPLv3+ & LGPLv2.1+" +LICENSE_${PN} = "LGPLv2.1+" +LICENSE_${PN}-xx = "LGPLv2.1+" +LICENSE_${PN}-bin = "GPLv3+" +LICENSE_${PN}-openssl = "GPLv3+" + +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343" + + +SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}" + +SRC_URI = "ftp://ftp.gnutls.org/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz" + +inherit autotools-brokensep texinfo binconfig pkgconfig gettext lib_package + +EXTRA_OECONF="--disable-rpath \ + --with-included-libtasn1 \ + --enable-local-libopts \ + --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \ + --with-libz-prefix=${STAGING_DIR_HOST}${prefix} \ + --disable-guile \ + --disable-crywrap \ + --without-p11-kit \ + " + +do_configure_prepend() { + for dir in . lib; do + rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4 + done +} + +PACKAGECONFIG ??= "" +PACKAGECONFIG[tpm] = "--with-tpm, --without-tpm, trousers" + +PACKAGES =+ "${PN}-openssl ${PN}-xx" + +FILES_${PN}-dev += "${bindir}/gnutls-cli-debug" +FILES_${PN}-openssl = "${libdir}/libgnutls-openssl.so.*" +FILES_${PN}-xx = "${libdir}/libgnutlsxx.so.*" + +LDFLAGS_append_libc-uclibc += " -pthread" + +BBCLASSEXTEND = "native nativesdk" 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 + diff --git a/meta/recipes-support/gnutls/gnutls_3.3.5.bb b/meta/recipes-support/gnutls/gnutls_3.3.5.bb new file mode 100644 index 0000000000..9f26470f41 --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls_3.3.5.bb @@ -0,0 +1,9 @@ +require gnutls.inc + +SRC_URI += "file://correct_rpl_gettimeofday_signature.patch \ + file://eliminated-double-free-CVE-2015-3308.patch \ + file://better-fix-for-double-free-CVE-2015-3308.patch \ + " + +SRC_URI[md5sum] = "1f396dcf3c14ea67de7243821006d1a2" +SRC_URI[sha256sum] = "48f34ae032692c498e782e9f1369506572be40ecf7f3f3604b0b00bad1b10477" diff --git a/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch b/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch new file mode 100644 index 0000000000..2ac89f3b32 --- /dev/null +++ b/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch @@ -0,0 +1,14 @@ +Upstream-Status: Inappropriate + +Signed-off-by: Marko Lindqvist +diff -Nurd libtasn1-2.14/doc/Makefile.am libtasn1-2.14/doc/Makefile.am +--- libtasn1-2.14/doc/Makefile.am 2012-09-24 15:08:42.000000000 +0300 ++++ libtasn1-2.14/doc/Makefile.am 2013-01-03 07:35:26.702763403 +0200 +@@ -31,7 +31,7 @@ + AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) \ + --no-split --number-sections --css-include=texinfo.css + +-dist_man_MANS = $(gdoc_MANS) asn1Parser.1 asn1Coding.1 asn1Decoding.1 ++dist_man_MANS = $(gdoc_MANS) + + HELP2MAN_OPTS = --info-page libtasn1 diff --git a/meta/recipes-support/gnutls/libtasn1/libtasn1-CVE-2015-3622.patch b/meta/recipes-support/gnutls/libtasn1/libtasn1-CVE-2015-3622.patch new file mode 100644 index 0000000000..0989ef6a21 --- /dev/null +++ b/meta/recipes-support/gnutls/libtasn1/libtasn1-CVE-2015-3622.patch @@ -0,0 +1,44 @@ +From f979435823a02f842c41d49cd41cc81f25b5d677 Mon Sep 17 00:00:00 2001 +From: Nikos Mavrogiannopoulos +Date: Mon, 20 Apr 2015 14:56:27 +0200 +Subject: [PATCH] _asn1_extract_der_octet: prevent past of boundary access + +Fixes CVE-2015-3622. +Upstream-Status: Backport + +Reported by Hanno Böck. +--- + lib/decoding.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/lib/decoding.c b/lib/decoding.c +index 7fbd931..42ddc6b 100644 +--- a/lib/decoding.c ++++ b/lib/decoding.c +@@ -732,6 +732,7 @@ _asn1_extract_der_octet (asn1_node node, const unsigned char *der, + return ASN1_DER_ERROR; + + counter = len3 + 1; ++ DECR_LEN(der_len, len3); + + if (len2 == -1) + counter_end = der_len - 2; +@@ -740,6 +741,7 @@ _asn1_extract_der_octet (asn1_node node, const unsigned char *der, + + while (counter < counter_end) + { ++ DECR_LEN(der_len, 1); + len2 = asn1_get_length_der (der + counter, der_len, &len3); + + if (IS_ERR(len2, flags)) +@@ -764,7 +766,6 @@ _asn1_extract_der_octet (asn1_node node, const unsigned char *der, + len2 = 0; + } + +- DECR_LEN(der_len, 1); + counter += len2 + len3 + 1; + } + +-- +1.7.2.5 + diff --git a/meta/recipes-support/gnutls/libtasn1/libtasn1_fix_for_automake_1.12.patch b/meta/recipes-support/gnutls/libtasn1/libtasn1_fix_for_automake_1.12.patch new file mode 100644 index 0000000000..5540bef940 --- /dev/null +++ b/meta/recipes-support/gnutls/libtasn1/libtasn1_fix_for_automake_1.12.patch @@ -0,0 +1,28 @@ +Upstream-Status: Pending + +This patch avoids following issues with automake 1.12: + +| automake: warnings are treated as errors +| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libtasn1.la': linking libtool libraries using a non-POSIX +| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac' + +Signed-Off-By: Nitin A Kamble +2012/05/02 + + +Index: libtasn1-2.11/configure.ac +=================================================================== +--- libtasn1-2.11.orig/configure.ac ++++ libtasn1-2.11/configure.ac +@@ -38,6 +38,11 @@ lgl_EARLY + AC_PROG_YACC + AC_PROG_LN_S + ++# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it ++m4_pattern_allow([AM_PROG_AR]) ++AM_PROG_AR ++ ++ + dnl Checks for programs. + AC_PROG_INSTALL + AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir) diff --git a/meta/recipes-support/gnutls/libtasn1_4.0.bb b/meta/recipes-support/gnutls/libtasn1_4.0.bb new file mode 100644 index 0000000000..16cf4d6812 --- /dev/null +++ b/meta/recipes-support/gnutls/libtasn1_4.0.bb @@ -0,0 +1,22 @@ +SUMMARY = "Library for ASN.1 and DER manipulation" +HOMEPAGE = "http://www.gnu.org/software/libtasn1/" + +LICENSE = "GPLv3+ & LGPLv2.1+" +LICENSE_${PN}-bin = "GPLv3+" +LICENSE_${PN} = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \ + file://README;endline=8;md5=c3803a3e8ca5ab5eb1e5912faa405351" + +SRC_URI = "${GNU_MIRROR}/libtasn1/libtasn1-${PV}.tar.gz \ + file://libtasn1_fix_for_automake_1.12.patch \ + file://dont-depend-on-help2man.patch \ + file://libtasn1-CVE-2015-3622.patch \ + " + +SRC_URI[md5sum] = "d3d2d9bce3b6668b9827a9df52635be1" +SRC_URI[sha256sum] = "41d044f7644bdd1c4f8a5c15ac1885ca1fcbf32f5f6dd4760a19278b979857fe" + +inherit autotools texinfo binconfig lib_package + +BBCLASSEXTEND = "native" -- cgit v1.2.3-54-g00ecf