From: Greg Kroah-Hartman Date: Thu, 10 Dec 2015 18:01:50 +0000 (-0500) Subject: 4.3-stable patches X-Git-Tag: v4.3.2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61d69c3a8710d06aedd956f85aec2a1f8aabbe91;p=thirdparty%2Fkernel%2Fstable-queue.git 4.3-stable patches added patches: crypto-asymmetric_keys-remove-always-false-comparison.patch x.509-fix-the-time-validation.patch --- diff --git a/queue-4.3/crypto-asymmetric_keys-remove-always-false-comparison.patch b/queue-4.3/crypto-asymmetric_keys-remove-always-false-comparison.patch new file mode 100644 index 00000000000..f48857ef574 --- /dev/null +++ b/queue-4.3/crypto-asymmetric_keys-remove-always-false-comparison.patch @@ -0,0 +1,34 @@ +From 4dd17c9c8a30c8d8cd1c9d4b94f08aca4b038d3e Mon Sep 17 00:00:00 2001 +From: sudip +Date: Thu, 17 Sep 2015 13:12:51 +0530 +Subject: crypto: asymmetric_keys - remove always false comparison + +From: sudip + +commit 4dd17c9c8a30c8d8cd1c9d4b94f08aca4b038d3e upstream. + +hour, min and sec are unsigned int and they can never be less than zero. + +Signed-off-by: Sudip Mukherjee +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + crypto/asymmetric_keys/x509_cert_parser.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/crypto/asymmetric_keys/x509_cert_parser.c ++++ b/crypto/asymmetric_keys/x509_cert_parser.c +@@ -546,9 +546,9 @@ int x509_decode_time(time64_t *_t, size + if (year < 1970 || + mon < 1 || mon > 12 || + day < 1 || day > mon_len || +- hour < 0 || hour > 23 || +- min < 0 || min > 59 || +- sec < 0 || sec > 59) ++ hour > 23 || ++ min > 59 || ++ sec > 59) + goto invalid_time; + + *_t = mktime64(year, mon, day, hour, min, sec); diff --git a/queue-4.3/x.509-fix-the-time-validation.patch b/queue-4.3/x.509-fix-the-time-validation.patch new file mode 100644 index 00000000000..e6677d6c582 --- /dev/null +++ b/queue-4.3/x.509-fix-the-time-validation.patch @@ -0,0 +1,87 @@ +From cc25b994acfbc901429da682d0f73c190e960206 Mon Sep 17 00:00:00 2001 +From: David Howells +Date: Thu, 12 Nov 2015 09:36:40 +0000 +Subject: X.509: Fix the time validation [ver #2] + +From: David Howells + +commit cc25b994acfbc901429da682d0f73c190e960206 upstream. + +This fixes CVE-2015-5327. It affects kernels from 4.3-rc1 onwards. + +Fix the X.509 time validation to use month number-1 when looking up the +number of days in that month. Also put the month number validation before +doing the lookup so as not to risk overrunning the array. + +This can be tested by doing the following: + +cat < +Signed-off-by: David Howells +Tested-by: Mimi Zohar +Acked-by: David Woodhouse +Signed-off-by: James Morris +Signed-off-by: Greg Kroah-Hartman + +--- + crypto/asymmetric_keys/x509_cert_parser.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +--- a/crypto/asymmetric_keys/x509_cert_parser.c ++++ b/crypto/asymmetric_keys/x509_cert_parser.c +@@ -531,7 +531,11 @@ int x509_decode_time(time64_t *_t, size + if (*p != 'Z') + goto unsupported_time; + +- mon_len = month_lengths[mon]; ++ if (year < 1970 || ++ mon < 1 || mon > 12) ++ goto invalid_time; ++ ++ mon_len = month_lengths[mon - 1]; + if (mon == 2) { + if (year % 4 == 0) { + mon_len = 29; +@@ -543,14 +547,12 @@ int x509_decode_time(time64_t *_t, size + } + } + +- if (year < 1970 || +- mon < 1 || mon > 12 || +- day < 1 || day > mon_len || ++ if (day < 1 || day > mon_len || + hour > 23 || + min > 59 || + sec > 59) + goto invalid_time; +- ++ + *_t = mktime64(year, mon, day, hour, min, sec); + return 0; +