Browse code

kernels: Update to version 4.4.130

Extras:
- Fix CVE-2018-1000026
- Remove references to linux-secure and linux-aws in
pkg_build_options.json, as they are only available in
Photon OS 2.0 and above.

Change-Id: I48a6a0315211e5bf1cb5018dd2a3f84dce276f56
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5104
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Bo Gan <ganb@vmware.com>

Srivatsa S. Bhat authored on 2018/05/01 04:45:47
Showing 6 changed files
... ...
@@ -1,14 +1,14 @@
1 1
 Summary:	Linux API header files
2 2
 Name:		linux-api-headers
3
-Version:	4.4.124
4
-Release:	2%{?dist}
3
+Version:	4.4.130
4
+Release:	1%{?dist}
5 5
 License:	GPLv2
6 6
 URL:		http://www.kernel.org/
7 7
 Group:		System Environment/Kernel
8 8
 Vendor:		VMware, Inc.
9 9
 Distribution: Photon
10 10
 Source0:    	http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
11
-%define sha1 linux=d5241400e6e5ed97fbdba1f92cf62c0a4382a30a
11
+%define sha1 linux=301ecffcd9714f17b229c0eaff8a711a419bbbdb
12 12
 BuildArch:	noarch
13 13
 # From SPECS/linux and used by linux-esx only
14 14
 # It provides f*xattrat syscalls
... ...
@@ -29,6 +29,8 @@ find /%{buildroot}%{_includedir} \( -name .install -o -name ..install.cmd \) -de
29 29
 %defattr(-,root,root)
30 30
 %{_includedir}/*
31 31
 %changelog
32
+*   Mon Apr 30 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.130-1
33
+-   Update to version 4.4.130
32 34
 *   Thu Apr 19 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.124-2
33 35
 -   Add full retpoline support by building with retpoline-enabled gcc.
34 36
 *   Tue Mar 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.124-1
35 37
new file mode 100644
... ...
@@ -0,0 +1,131 @@
0
+From 2b16f048729bf35e6c28a40cbfad07239f9dcd90 Mon Sep 17 00:00:00 2001
1
+From: Daniel Axtens <dja@axtens.net>
2
+Date: Wed, 31 Jan 2018 14:15:33 +1100
3
+Subject: [PATCH] net: create skb_gso_validate_mac_len()
4
+
5
+If you take a GSO skb, and split it into packets, will the MAC
6
+length (L2 + L3 + L4 headers + payload) of those packets be small
7
+enough to fit within a given length?
8
+
9
+Move skb_gso_mac_seglen() to skbuff.h with other related functions
10
+like skb_gso_network_seglen() so we can use it, and then create
11
+skb_gso_validate_mac_len to do the full calculation.
12
+
13
+Signed-off-by: Daniel Axtens <dja@axtens.net>
14
+Signed-off-by: David S. Miller <davem@davemloft.net>
15
+[ Srivatsa: Removed all references to GSO_BY_FRAGS, as that feature is not
16
+available on 4.4 kernels. ]
17
+Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu>
18
+---
19
+ include/linux/skbuff.h | 16 +++++++++++++
20
+ net/core/skbuff.c      | 63 +++++++++++++++++++++++++++++++++++++++-----------
21
+ net/sched/sch_tbf.c    | 10 --------
22
+ 3 files changed, 66 insertions(+), 23 deletions(-)
23
+
24
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
25
+index a6da214..2a62725 100644
26
+--- a/include/linux/skbuff.h
27
+@@ -2896,6 +2896,7 @@ void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len);
28
+ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);
29
+ void skb_scrub_packet(struct sk_buff *skb, bool xnet);
30
+ unsigned int skb_gso_transport_seglen(const struct sk_buff *skb);
31
++bool skb_gso_validate_mac_len(const struct sk_buff *skb, unsigned int len);
32
+ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
33
+ struct sk_buff *skb_vlan_untag(struct sk_buff *skb);
34
+ int skb_ensure_writable(struct sk_buff *skb, int write_len);
35
+@@ -3651,5 +3652,20 @@ static inline unsigned int skb_gso_network_seglen(const struct sk_buff *skb)
36
+ 	return hdr_len + skb_gso_transport_seglen(skb);
37
+ }
38
+ 
39
++/**
40
++ * skb_gso_mac_seglen - Return length of individual segments of a gso packet
41
++ *
42
++ * @skb: GSO skb
43
++ *
44
++ * skb_gso_mac_seglen is used to determine the real size of the
45
++ * individual segments, including MAC/L2, Layer3 (IP, IPv6) and L4
46
++ * headers (TCP/UDP).
47
++ */
48
++static inline unsigned int skb_gso_mac_seglen(const struct sk_buff *skb)
49
++{
50
++	unsigned int hdr_len = skb_transport_header(skb) - skb_mac_header(skb);
51
++	return hdr_len + skb_gso_transport_seglen(skb);
52
++}
53
++
54
+ #endif	/* __KERNEL__ */
55
+ #endif	/* _LINUX_SKBUFF_H */
56
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c
57
+index 7d344259..3c42478 100644
58
+--- a/net/core/skbuff.c
59
+@@ -4292,6 +4292,46 @@ unsigned int skb_gso_transport_seglen(const struct sk_buff *skb)
60
+ }
61
+ EXPORT_SYMBOL_GPL(skb_gso_transport_seglen);
62
+ 
63
++/**
64
++ * skb_gso_size_check - check the skb size
65
++ *
66
++ * There are a couple of instances where we have a GSO skb, and we
67
++ * want to determine what size it would be after it is segmented.
68
++ *
69
++ * We might want to check:
70
++ * -    L3+L4+payload size (e.g. IP forwarding)
71
++ * - L2+L3+L4+payload size (e.g. sanity check before passing to driver)
72
++ *
73
++ * This is a helper to do that correctly.
74
++ *
75
++ * @seg_len: The segmented length (from skb_gso_*_seglen).
76
++ *
77
++ * @max_len: The maximum permissible length.
78
++ *
79
++ * Returns true if the segmented length <= max length.
80
++ */
81
++static inline bool skb_gso_size_check(const struct sk_buff *skb,
82
++				      unsigned int seg_len,
83
++				      unsigned int max_len) {
84
++	return seg_len <= max_len;
85
++}
86
++
87
++
88
++/**
89
++ * skb_gso_validate_mac_len - Will a split GSO skb fit in a given length?
90
++ *
91
++ * @skb: GSO skb
92
++ * @len: length to validate against
93
++ *
94
++ * skb_gso_validate_mac_len validates if a given skb will fit a wanted
95
++ * length once split, including L2, L3 and L4 headers and the payload.
96
++ */
97
++bool skb_gso_validate_mac_len(const struct sk_buff *skb, unsigned int len)
98
++{
99
++	return skb_gso_size_check(skb, skb_gso_mac_seglen(skb), len);
100
++}
101
++EXPORT_SYMBOL_GPL(skb_gso_validate_mac_len);
102
++
103
+ static struct sk_buff *skb_reorder_vlan_header(struct sk_buff *skb)
104
+ {
105
+ 	if (skb_cow(skb, skb_headroom(skb)) < 0) {
106
+diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
107
+index c2fbde7..93d6a21 100644
108
+--- a/net/sched/sch_tbf.c
109
+@@ -142,16 +142,6 @@ static u64 psched_ns_t2l(const struct psched_ratecfg *r,
110
+ 	return len;
111
+ }
112
+ 
113
+-/*
114
+- * Return length of individual segments of a gso packet,
115
+- * including all headers (MAC, IP, TCP/UDP)
116
+- */
117
+-static unsigned int skb_gso_mac_seglen(const struct sk_buff *skb)
118
+-{
119
+-	unsigned int hdr_len = skb_transport_header(skb) - skb_mac_header(skb);
120
+-	return hdr_len + skb_gso_transport_seglen(skb);
121
+-}
122
+-
123
+ /* GSO packet is too big, segment it so that tbf can transmit
124
+  * each segment in time
125
+  */
126
+-- 
127
+2.7.4
0 128
new file mode 100644
... ...
@@ -0,0 +1,57 @@
0
+From 8914a595110a6eca69a5e275b323f5d09e18f4f9 Mon Sep 17 00:00:00 2001
1
+From: Daniel Axtens <dja@axtens.net>
2
+Date: Wed, 31 Jan 2018 14:15:34 +1100
3
+Subject: [PATCH] bnx2x: disable GSO where gso_size is too big for hardware
4
+
5
+If a bnx2x card is passed a GSO packet with a gso_size larger than
6
+~9700 bytes, it will cause a firmware error that will bring the card
7
+down:
8
+
9
+bnx2x: [bnx2x_attn_int_deasserted3:4323(enP24p1s0f0)]MC assert!
10
+bnx2x: [bnx2x_mc_assert:720(enP24p1s0f0)]XSTORM_ASSERT_LIST_INDEX 0x2
11
+bnx2x: [bnx2x_mc_assert:736(enP24p1s0f0)]XSTORM_ASSERT_INDEX 0x0 = 0x00000000 0x25e43e47 0x00463e01 0x00010052
12
+bnx2x: [bnx2x_mc_assert:750(enP24p1s0f0)]Chip Revision: everest3, FW Version: 7_13_1
13
+... (dump of values continues) ...
14
+
15
+Detect when the mac length of a GSO packet is greater than the maximum
16
+packet size (9700 bytes) and disable GSO.
17
+
18
+Signed-off-by: Daniel Axtens <dja@axtens.net>
19
+Reviewed-by: Eric Dumazet <edumazet@google.com>
20
+Signed-off-by: David S. Miller <davem@davemloft.net>
21
+[ Srivatsa: Removed reference to GSO_BY_FRAGS, as that feature is not
22
+available on 4.4 kernels. ]
23
+Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu>
24
+---
25
+ drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 18 ++++++++++++++++++
26
+ 1 file changed, 18 insertions(+)
27
+
28
+diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
29
+index 8ddb68a..5a7c775 100644
30
+--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
31
+@@ -12818,6 +12818,22 @@ static netdev_features_t bnx2x_features_check(struct sk_buff *skb,
32
+ 					      struct net_device *dev,
33
+ 					      netdev_features_t features)
34
+ {
35
++	/*
36
++	 * A skb with gso_size + header length > 9700 will cause a
37
++	 * firmware panic. Drop GSO support.
38
++	 *
39
++	 * Eventually the upper layer should not pass these packets down.
40
++	 *
41
++	 * For speed, if the gso_size is <= 9000, assume there will
42
++	 * not be 700 bytes of headers and pass it through. Only do a
43
++	 * full (slow) validation if the gso_size is > 9000.
44
++	 *
45
++	 */
46
++	if (unlikely(skb_is_gso(skb) &&
47
++		     (skb_shinfo(skb)->gso_size > 9000) &&
48
++		     !skb_gso_validate_mac_len(skb, 9700)))
49
++		features &= ~NETIF_F_GSO_MASK;
50
++
51
+ 	features = vlan_features_check(skb, features);
52
+ 	return vxlan_features_check(skb, features);
53
+ }
54
+-- 
55
+2.7.4
... ...
@@ -1,15 +1,15 @@
1 1
 %global security_hardening none
2 2
 Summary:       Kernel
3 3
 Name:          linux-esx
4
-Version:       4.4.124
5
-Release:       2%{?dist}
4
+Version:       4.4.130
5
+Release:       1%{?dist}
6 6
 License:       GPLv2
7 7
 URL:           http://www.kernel.org/
8 8
 Group:         System Environment/Kernel
9 9
 Vendor:        VMware, Inc.
10 10
 Distribution:  Photon
11 11
 Source0:       http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
12
-%define sha1 linux=d5241400e6e5ed97fbdba1f92cf62c0a4382a30a
12
+%define sha1 linux=301ecffcd9714f17b229c0eaff8a711a419bbbdb
13 13
 Source1:       config-esx
14 14
 Patch0:        double-tcp_mem-limits.patch
15 15
 Patch1:        linux-4.4-sysctl-sched_weighted_cpuload_uses_rla.patch
... ...
@@ -37,6 +37,9 @@ Patch22:       vsock-transport-for-9p.patch
37 37
 Patch23:       p9fs_dir_readdir-offset-support.patch
38 38
 Patch24:       Implement-the-f-xattrat-family-of-functions.patch
39 39
 Patch26:       init-do_mounts-recreate-dev-root.patch
40
+# Fixes for CVE-2018-1000026
41
+Patch27:       0001-net-create-skb_gso_validate_mac_len.patch
42
+Patch28:       0002-bnx2x-disable-GSO-where-gso_size-is-too-big-for-hard.patch
40 43
 # For Spectre
41 44
 Patch52: 0141-locking-barriers-introduce-new-observable-speculatio.patch
42 45
 Patch55: 0144-uvcvideo-prevent-speculative-execution.patch
... ...
@@ -114,6 +117,8 @@ The Linux package contains the Linux kernel doc files
114 114
 %patch23 -p1
115 115
 %patch24 -p1
116 116
 %patch26 -p1
117
+%patch27 -p1
118
+%patch28 -p1
117 119
 
118 120
 %patch52 -p1
119 121
 %patch55 -p1
... ...
@@ -217,6 +222,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
217 217
 /usr/src/linux-headers-%{uname_r}
218 218
 
219 219
 %changelog
220
+*   Mon Apr 30 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.130-1
221
+-   Update to version 4.4.130 and fix CVE-2018-1000026.
220 222
 *   Thu Apr 19 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.124-2
221 223
 -   Add full retpoline support by building with retpoline-enabled gcc.
222 224
 *   Tue Mar 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.124-1
... ...
@@ -1,15 +1,15 @@
1 1
 %global security_hardening none
2 2
 Summary:        Kernel
3 3
 Name:           linux
4
-Version:    	4.4.124
5
-Release:        2%{?kat_build:.%kat_build}%{?dist}
4
+Version:    	4.4.130
5
+Release:        1%{?kat_build:.%kat_build}%{?dist}
6 6
 License:    	GPLv2
7 7
 URL:        	http://www.kernel.org/
8 8
 Group:        	System Environment/Kernel
9 9
 Vendor:         VMware, Inc.
10 10
 Distribution: 	Photon
11 11
 Source0:    	http://www.kernel.org/pub/linux/kernel/v4.x/%{name}-%{version}.tar.xz
12
-%define sha1 linux=d5241400e6e5ed97fbdba1f92cf62c0a4382a30a
12
+%define sha1 linux=301ecffcd9714f17b229c0eaff8a711a419bbbdb
13 13
 Source1:	config
14 14
 %define ena_version 1.1.3
15 15
 Source2:    	https://github.com/amzn/amzn-drivers/archive/ena_linux_1.1.3.tar.gz
... ...
@@ -36,6 +36,9 @@ Patch16:        vsock-transport-for-9p.patch
36 36
 #allow some algorithms in FIPS mode
37 37
 Patch17:        0001-Revert-crypto-testmgr-Disable-fips-allowed-for-authe.patch
38 38
 Patch18:        0002-allow-also-ecb-cipher_null.patch
39
+# Fixes for CVE-2018-1000026
40
+Patch19:        0001-net-create-skb_gso_validate_mac_len.patch
41
+Patch20:        0002-bnx2x-disable-GSO-where-gso_size-is-too-big-for-hard.patch
39 42
 # For Spectre
40 43
 Patch52: 0141-locking-barriers-introduce-new-observable-speculatio.patch
41 44
 Patch55: 0144-uvcvideo-prevent-speculative-execution.patch
... ...
@@ -144,6 +147,8 @@ This package contains the 'perf' performance analysis tools for Linux kernel.
144 144
 %patch16 -p1
145 145
 %patch17 -p1
146 146
 %patch18 -p1
147
+%patch19 -p1
148
+%patch20 -p1
147 149
 
148 150
 %patch52 -p1
149 151
 %patch55 -p1
... ...
@@ -315,6 +320,8 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
315 315
 /usr/share/perf-core
316 316
 
317 317
 %changelog
318
+*   Mon Apr 30 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.130-1
319
+-   Update to version 4.4.130 and fix CVE-2018-1000026.
318 320
 *   Thu Apr 19 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.124-2
319 321
 -   Add full retpoline support by building with retpoline-enabled gcc.
320 322
 *   Tue Mar 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.4.124-1
... ...
@@ -53,35 +53,5 @@
53 53
                      {"package": "libgomp", "version": "7.3.0"},
54 54
                      {"package": "libgomp-devel", "version": "7.3.0"}
55 55
         ]
56
-    },
57
-
58
-    "linux-secure": {
59
-        "files": [],
60
-        "macros": [],
61
-        "override_toolchain": [
62
-                     {"package": "gcc", "version": "7.3.0"},
63
-                     {"package": "libgcc", "version": "7.3.0"},
64
-                     {"package": "libgcc-devel", "version": "7.3.0"},
65
-                     {"package": "libgcc-atomic", "version": "7.3.0"},
66
-                     {"package": "libstdc++", "version": "7.3.0"},
67
-                     {"package": "libstdc++-devel", "version": "7.3.0"},
68
-                     {"package": "libgomp", "version": "7.3.0"},
69
-                     {"package": "libgomp-devel", "version": "7.3.0"}
70
-        ]
71
-    },
72
-
73
-    "linux-aws": {
74
-        "files": [],
75
-        "macros": [],
76
-        "override_toolchain": [
77
-                     {"package": "gcc", "version": "7.3.0"},
78
-                     {"package": "libgcc", "version": "7.3.0"},
79
-                     {"package": "libgcc-devel", "version": "7.3.0"},
80
-                     {"package": "libgcc-atomic", "version": "7.3.0"},
81
-                     {"package": "libstdc++", "version": "7.3.0"},
82
-                     {"package": "libstdc++-devel", "version": "7.3.0"},
83
-                     {"package": "libgomp", "version": "7.3.0"},
84
-                     {"package": "libgomp-devel", "version": "7.3.0"}
85
-        ]
86 56
     }
87 57
 }