diff options
| author | Sona Sarmadi <sona.sarmadi@enea.com> | 2015-12-14 09:36:45 +0100 |
|---|---|---|
| committer | Mihaela Martinas <Mihaela.Martinas@enea.com> | 2015-12-14 13:57:13 +0100 |
| commit | 265f875c5aeb50e2cb443315ea3674a93d7024b5 (patch) | |
| tree | 6381aa1e0f80d87c6e95316ba4d34541553c41a9 | |
| parent | cdf91befc739cbeae281e7bd4a4ff0028e6e10c6 (diff) | |
| download | poky-265f875c5aeb50e2cb443315ea3674a93d7024b5.tar.gz | |
openssl: CVE-2015-3194, CVE-2015-3195
Fixes following vulnerabilities:
Certificate verify crash with missing PSS parameter (CVE-2015-3194)
X509_ATTRIBUTE memory leak (CVE-2015-3195)
References:
https://openssl.org/news/secadv/20151203.txt
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3194
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3195
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
3 files changed, 96 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2015-3194-Add-PSS-parameter-check.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2015-3194-Add-PSS-parameter-check.patch new file mode 100644 index 0000000000..3c00bc1d0d --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl/CVE-2015-3194-Add-PSS-parameter-check.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | Date: Fri, 2 Oct 2015 13:10:29 +0100 | ||
| 2 | Subject: [PATCH] Add PSS parameter check. | ||
| 3 | |||
| 4 | Avoid seg fault by checking mgf1 parameter is not NULL. This can be | ||
| 5 | triggered during certificate verification so could be a DoS attack | ||
| 6 | against a client or a server enabling client authentication. | ||
| 7 | |||
| 8 | Thanks to Loïc Jonas Etienne (Qnective AG) for discovering this bug. | ||
| 9 | |||
| 10 | CVE-2015-3194 | ||
| 11 | |||
| 12 | Upstream-Status: Backport | ||
| 13 | |||
| 14 | Reviewed-by: Matt Caswell <matt@openssl.org> | ||
| 15 | Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com> | ||
| 16 | --- | ||
| 17 | crypto/rsa/rsa_ameth.c | 2 +- | ||
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 19 | |||
| 20 | diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c | ||
| 21 | index 93e071d..c7f1148 100644 | ||
| 22 | --- a/crypto/rsa/rsa_ameth.c | ||
| 23 | +++ b/crypto/rsa/rsa_ameth.c | ||
| 24 | @@ -279,7 +279,7 @@ static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg, | ||
| 25 | if (pss->maskGenAlgorithm) { | ||
| 26 | ASN1_TYPE *param = pss->maskGenAlgorithm->parameter; | ||
| 27 | if (OBJ_obj2nid(pss->maskGenAlgorithm->algorithm) == NID_mgf1 | ||
| 28 | - && param->type == V_ASN1_SEQUENCE) { | ||
| 29 | + && param && param->type == V_ASN1_SEQUENCE) { | ||
| 30 | p = param->value.sequence->data; | ||
| 31 | plen = param->value.sequence->length; | ||
| 32 | *pmaskHash = d2i_X509_ALGOR(NULL, &p, plen); | ||
| 33 | -- | ||
| 34 | 1.9.1 | ||
| 35 | |||
diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch new file mode 100644 index 0000000000..87c4c6c125 --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl/CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | Date: Tue, 10 Nov 2015 19:03:07 +0000 | ||
| 2 | Subject: [PATCH] Fix leak with ASN.1 combine. | ||
| 3 | |||
| 4 | When parsing a combined structure pass a flag to the decode routine | ||
| 5 | so on error a pointer to the parent structure is not zeroed as | ||
| 6 | this will leak any additional components in the parent. | ||
| 7 | |||
| 8 | This can leak memory in any application parsing PKCS#7 or CMS structures. | ||
| 9 | |||
| 10 | CVE-2015-3195. | ||
| 11 | |||
| 12 | Upstream-Status: Backport | ||
| 13 | |||
| 14 | Thanks to Adam Langley (Google/BoringSSL) for discovering this bug using | ||
| 15 | libFuzzer. | ||
| 16 | |||
| 17 | PR#4131 | ||
| 18 | |||
| 19 | Reviewed-by: Richard Levitte <levitte@openssl.org> | ||
| 20 | Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com> | ||
| 21 | --- | ||
| 22 | crypto/asn1/tasn_dec.c | 7 +++++-- | ||
| 23 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c | ||
| 26 | index febf605..9256049 100644 | ||
| 27 | --- a/crypto/asn1/tasn_dec.c | ||
| 28 | +++ b/crypto/asn1/tasn_dec.c | ||
| 29 | @@ -180,6 +180,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, | ||
| 30 | int otag; | ||
| 31 | int ret = 0; | ||
| 32 | ASN1_VALUE **pchptr, *ptmpval; | ||
| 33 | + int combine = aclass & ASN1_TFLG_COMBINE; | ||
| 34 | + aclass &= ~ASN1_TFLG_COMBINE; | ||
| 35 | if (!pval) | ||
| 36 | return 0; | ||
| 37 | if (aux && aux->asn1_cb) | ||
| 38 | @@ -500,7 +502,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, | ||
| 39 | auxerr: | ||
| 40 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR); | ||
| 41 | err: | ||
| 42 | - ASN1_item_ex_free(pval, it); | ||
| 43 | + if (combine == 0) | ||
| 44 | + ASN1_item_ex_free(pval, it); | ||
| 45 | if (errtt) | ||
| 46 | ERR_add_error_data(4, "Field=", errtt->field_name, | ||
| 47 | ", Type=", it->sname); | ||
| 48 | @@ -689,7 +692,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val, | ||
| 49 | } else { | ||
| 50 | /* Nothing special */ | ||
| 51 | ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), | ||
| 52 | - -1, 0, opt, ctx); | ||
| 53 | + -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx); | ||
| 54 | if (!ret) { | ||
| 55 | ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
| 56 | goto err; | ||
| 57 | -- | ||
| 58 | 1.9.1 | ||
| 59 | |||
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb b/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb index 3f6179089b..1d0242f504 100644 --- a/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb +++ b/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb | |||
| @@ -34,6 +34,8 @@ SRC_URI += "file://configure-targets.patch \ | |||
| 34 | file://Makefiles-ptest.patch \ | 34 | file://Makefiles-ptest.patch \ |
| 35 | file://ptest-deps.patch \ | 35 | file://ptest-deps.patch \ |
| 36 | file://run-ptest \ | 36 | file://run-ptest \ |
| 37 | file://CVE-2015-3194-Add-PSS-parameter-check.patch \ | ||
| 38 | file://CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch \ | ||
| 37 | " | 39 | " |
| 38 | 40 | ||
| 39 | SRC_URI[md5sum] = "7563e92327199e0067ccd0f79f436976" | 41 | SRC_URI[md5sum] = "7563e92327199e0067ccd0f79f436976" |
