diff options
author | Leo Famulari <leo@famulari.name> | 2017-05-24 16:25:54 -0400 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2017-05-24 16:57:40 -0400 |
commit | ff51a87cae360334ed42c79c3e4e46fb7c121eb2 (patch) | |
tree | 89c51a069dfa00364bdac38361a7551a07134262 /gnu/packages | |
parent | 4ed390a0e7fc468303c07d6efebc54c80b2369c5 (diff) | |
download | guix-ff51a87cae360334ed42c79c3e4e46fb7c121eb2.tar.gz guix-ff51a87cae360334ed42c79c3e4e46fb7c121eb2.zip |
gnu: libtasn1: Fix CVE-2017-6891.
* gnu/packages/patches/libtasn1-CVE-2017-6891.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/tls.scm (libtasn1)[replacement]: New field.
(libtasn1/fixed): New variable.
Diffstat (limited to 'gnu/packages')
-rw-r--r-- | gnu/packages/patches/libtasn1-CVE-2017-6891.patch | 51 | ||||
-rw-r--r-- | gnu/packages/tls.scm | 10 |
2 files changed, 61 insertions, 0 deletions
diff --git a/gnu/packages/patches/libtasn1-CVE-2017-6891.patch b/gnu/packages/patches/libtasn1-CVE-2017-6891.patch new file mode 100644 index 0000000000..1f847ed025 --- /dev/null +++ b/gnu/packages/patches/libtasn1-CVE-2017-6891.patch @@ -0,0 +1,51 @@ +Fix CVE-2017-6891: + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-6891 + +Patch copied from upstream source repository: + +https://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=5520704d075802df25ce4ffccc010ba1641bd484 + +From 5520704d075802df25ce4ffccc010ba1641bd484 Mon Sep 17 00:00:00 2001 +From: Nikos Mavrogiannopoulos <nmav@redhat.com> +Date: Thu, 18 May 2017 18:03:34 +0200 +Subject: [PATCH] asn1_find_node: added safety check on asn1_find_node() + +This prevents a stack overflow in asn1_find_node() which +is triggered by too long variable names in the definitions +files. That means that applications have to deliberately +pass a too long 'name' constant to asn1_write_value() +and friends. Reported by Jakub Jirasek. + +Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com> +--- + lib/parser_aux.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/lib/parser_aux.c b/lib/parser_aux.c +index b4a7370..976ab38 100644 +--- a/lib/parser_aux.c ++++ b/lib/parser_aux.c +@@ -120,6 +120,9 @@ asn1_find_node (asn1_node pointer, const char *name) + if (n_end) + { + nsize = n_end - n_start; ++ if (nsize >= sizeof(n)) ++ return NULL; ++ + memcpy (n, n_start, nsize); + n[nsize] = 0; + n_start = n_end; +@@ -158,6 +161,9 @@ asn1_find_node (asn1_node pointer, const char *name) + if (n_end) + { + nsize = n_end - n_start; ++ if (nsize >= sizeof(n)) ++ return NULL; ++ + memcpy (n, n_start, nsize); + n[nsize] = 0; + n_start = n_end; +-- +2.13.0 + diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index d50534081c..9f8c070a53 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -52,6 +52,7 @@ (define-public libtasn1 (package (name "libtasn1") + (replacement libtasn1/fixed) (version "4.10") (source (origin @@ -72,6 +73,15 @@ networking, allowing for formal validation of data according to some specifications.") (license license:lgpl2.0+))) +(define libtasn1/fixed + (package + (inherit libtasn1) + (source + (origin + (inherit (package-source libtasn1)) + (patches + (search-patches "libtasn1-CVE-2017-6891.patch")))))) + (define-public asn1c (package (name "asn1c") |