Magellan Linux

Contents of /trunk/kernel-magellan/patches-4.3/0101-4.3.2-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2745 - (show annotations) (download)
Mon Dec 28 09:57:03 2015 UTC (8 years, 4 months ago) by niro
File size: 1204 byte(s)
-linux-4.3.2
1 diff --git a/Makefile b/Makefile
2 index 266eeacc1490..1a4953b3e10f 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 4
7 PATCHLEVEL = 3
8 -SUBLEVEL = 1
9 +SUBLEVEL = 2
10 EXTRAVERSION =
11 NAME = Blurry Fish Butt
12
13 diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
14 index af71878dc15b..021d39c0ba75 100644
15 --- a/crypto/asymmetric_keys/x509_cert_parser.c
16 +++ b/crypto/asymmetric_keys/x509_cert_parser.c
17 @@ -531,7 +531,11 @@ int x509_decode_time(time64_t *_t, size_t hdrlen,
18 if (*p != 'Z')
19 goto unsupported_time;
20
21 - mon_len = month_lengths[mon];
22 + if (year < 1970 ||
23 + mon < 1 || mon > 12)
24 + goto invalid_time;
25 +
26 + mon_len = month_lengths[mon - 1];
27 if (mon == 2) {
28 if (year % 4 == 0) {
29 mon_len = 29;
30 @@ -543,14 +547,12 @@ int x509_decode_time(time64_t *_t, size_t hdrlen,
31 }
32 }
33
34 - if (year < 1970 ||
35 - mon < 1 || mon > 12 ||
36 - day < 1 || day > mon_len ||
37 - hour < 0 || hour > 23 ||
38 - min < 0 || min > 59 ||
39 - sec < 0 || sec > 59)
40 + if (day < 1 || day > mon_len ||
41 + hour > 23 ||
42 + min > 59 ||
43 + sec > 59)
44 goto invalid_time;
45 -
46 +
47 *_t = mktime64(year, mon, day, hour, min, sec);
48 return 0;
49