1 |
commit: 1346d58afe1360a7eb64307476c9de5bfe3eaf19 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 2 16:00:58 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 2 16:00:58 2015 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-patchset.git;a=commit;h=1346d58a |
7 |
|
8 |
Bump 3.2.65 to 3.2.66 |
9 |
|
10 |
--- |
11 |
{3.2.65 => 3.2.66}/0000_README | 4 + |
12 |
{3.2.65 => 3.2.66}/1021_linux-3.2.22.patch | 0 |
13 |
{3.2.65 => 3.2.66}/1022_linux-3.2.23.patch | 0 |
14 |
{3.2.65 => 3.2.66}/1023_linux-3.2.24.patch | 0 |
15 |
{3.2.65 => 3.2.66}/1024_linux-3.2.25.patch | 0 |
16 |
{3.2.65 => 3.2.66}/1025_linux-3.2.26.patch | 0 |
17 |
{3.2.65 => 3.2.66}/1026_linux-3.2.27.patch | 0 |
18 |
{3.2.65 => 3.2.66}/1027_linux-3.2.28.patch | 0 |
19 |
{3.2.65 => 3.2.66}/1028_linux-3.2.29.patch | 0 |
20 |
{3.2.65 => 3.2.66}/1029_linux-3.2.30.patch | 0 |
21 |
{3.2.65 => 3.2.66}/1030_linux-3.2.31.patch | 0 |
22 |
{3.2.65 => 3.2.66}/1031_linux-3.2.32.patch | 0 |
23 |
{3.2.65 => 3.2.66}/1032_linux-3.2.33.patch | 0 |
24 |
{3.2.65 => 3.2.66}/1033_linux-3.2.34.patch | 0 |
25 |
{3.2.65 => 3.2.66}/1034_linux-3.2.35.patch | 0 |
26 |
{3.2.65 => 3.2.66}/1035_linux-3.2.36.patch | 0 |
27 |
{3.2.65 => 3.2.66}/1036_linux-3.2.37.patch | 0 |
28 |
{3.2.65 => 3.2.66}/1037_linux-3.2.38.patch | 0 |
29 |
{3.2.65 => 3.2.66}/1038_linux-3.2.39.patch | 0 |
30 |
{3.2.65 => 3.2.66}/1039_linux-3.2.40.patch | 0 |
31 |
{3.2.65 => 3.2.66}/1040_linux-3.2.41.patch | 0 |
32 |
{3.2.65 => 3.2.66}/1041_linux-3.2.42.patch | 0 |
33 |
{3.2.65 => 3.2.66}/1042_linux-3.2.43.patch | 0 |
34 |
{3.2.65 => 3.2.66}/1043_linux-3.2.44.patch | 0 |
35 |
{3.2.65 => 3.2.66}/1044_linux-3.2.45.patch | 0 |
36 |
{3.2.65 => 3.2.66}/1045_linux-3.2.46.patch | 0 |
37 |
{3.2.65 => 3.2.66}/1046_linux-3.2.47.patch | 0 |
38 |
{3.2.65 => 3.2.66}/1047_linux-3.2.48.patch | 0 |
39 |
{3.2.65 => 3.2.66}/1048_linux-3.2.49.patch | 0 |
40 |
{3.2.65 => 3.2.66}/1049_linux-3.2.50.patch | 0 |
41 |
{3.2.65 => 3.2.66}/1050_linux-3.2.51.patch | 0 |
42 |
{3.2.65 => 3.2.66}/1051_linux-3.2.52.patch | 0 |
43 |
{3.2.65 => 3.2.66}/1052_linux-3.2.53.patch | 0 |
44 |
{3.2.65 => 3.2.66}/1053_linux-3.2.54.patch | 0 |
45 |
{3.2.65 => 3.2.66}/1054_linux-3.2.55.patch | 0 |
46 |
{3.2.65 => 3.2.66}/1055_linux-3.2.56.patch | 0 |
47 |
{3.2.65 => 3.2.66}/1056_linux-3.2.57.patch | 0 |
48 |
{3.2.65 => 3.2.66}/1057_linux-3.2.58.patch | 0 |
49 |
{3.2.65 => 3.2.66}/1058_linux-3.2.59.patch | 0 |
50 |
{3.2.65 => 3.2.66}/1059_linux-3.2.60.patch | 0 |
51 |
{3.2.65 => 3.2.66}/1060_linux-3.2.61.patch | 0 |
52 |
{3.2.65 => 3.2.66}/1061_linux-3.2.62.patch | 0 |
53 |
{3.2.65 => 3.2.66}/1062_linux-3.2.63.patch | 0 |
54 |
{3.2.65 => 3.2.66}/1063_linux-3.2.64.patch | 0 |
55 |
{3.2.65 => 3.2.66}/1064_linux-3.2.65.patch | 0 |
56 |
3.2.66/1065_linux-3.2.66.patch | 2041 ++++++++++++++++++++ |
57 |
.../4420_grsecurity-3.0-3.2.65-201412280855.patch | 0 |
58 |
{3.2.65 => 3.2.66}/4425_grsec_remove_EI_PAX.patch | 0 |
59 |
.../4427_force_XATTR_PAX_tmpfs.patch | 0 |
60 |
.../4430_grsec-remove-localversion-grsec.patch | 0 |
61 |
{3.2.65 => 3.2.66}/4435_grsec-mute-warnings.patch | 0 |
62 |
.../4440_grsec-remove-protected-paths.patch | 0 |
63 |
.../4450_grsec-kconfig-default-gids.patch | 0 |
64 |
.../4465_selinux-avc_audit-log-curr_ip.patch | 0 |
65 |
{3.2.65 => 3.2.66}/4470_disable-compat_vdso.patch | 0 |
66 |
{3.2.65 => 3.2.66}/4475_emutramp_default_on.patch | 0 |
67 |
56 files changed, 2045 insertions(+) |
68 |
|
69 |
diff --git a/3.2.65/0000_README b/3.2.66/0000_README |
70 |
similarity index 98% |
71 |
rename from 3.2.65/0000_README |
72 |
rename to 3.2.66/0000_README |
73 |
index 153f045..96a6e23 100644 |
74 |
--- a/3.2.65/0000_README |
75 |
+++ b/3.2.66/0000_README |
76 |
@@ -178,6 +178,10 @@ Patch: 1064_linux-3.2.65.patch |
77 |
From: http://www.kernel.org |
78 |
Desc: Linux 3.2.65 |
79 |
|
80 |
+Patch: 1065_linux-3.2.66.patch |
81 |
+From: http://www.kernel.org |
82 |
+Desc: Linux 3.2.66 |
83 |
+ |
84 |
Patch: 4420_grsecurity-3.0-3.2.65-201412280855.patch |
85 |
From: http://www.grsecurity.net |
86 |
Desc: hardened-sources base patch from upstream grsecurity |
87 |
|
88 |
diff --git a/3.2.65/1021_linux-3.2.22.patch b/3.2.66/1021_linux-3.2.22.patch |
89 |
similarity index 100% |
90 |
rename from 3.2.65/1021_linux-3.2.22.patch |
91 |
rename to 3.2.66/1021_linux-3.2.22.patch |
92 |
|
93 |
diff --git a/3.2.65/1022_linux-3.2.23.patch b/3.2.66/1022_linux-3.2.23.patch |
94 |
similarity index 100% |
95 |
rename from 3.2.65/1022_linux-3.2.23.patch |
96 |
rename to 3.2.66/1022_linux-3.2.23.patch |
97 |
|
98 |
diff --git a/3.2.65/1023_linux-3.2.24.patch b/3.2.66/1023_linux-3.2.24.patch |
99 |
similarity index 100% |
100 |
rename from 3.2.65/1023_linux-3.2.24.patch |
101 |
rename to 3.2.66/1023_linux-3.2.24.patch |
102 |
|
103 |
diff --git a/3.2.65/1024_linux-3.2.25.patch b/3.2.66/1024_linux-3.2.25.patch |
104 |
similarity index 100% |
105 |
rename from 3.2.65/1024_linux-3.2.25.patch |
106 |
rename to 3.2.66/1024_linux-3.2.25.patch |
107 |
|
108 |
diff --git a/3.2.65/1025_linux-3.2.26.patch b/3.2.66/1025_linux-3.2.26.patch |
109 |
similarity index 100% |
110 |
rename from 3.2.65/1025_linux-3.2.26.patch |
111 |
rename to 3.2.66/1025_linux-3.2.26.patch |
112 |
|
113 |
diff --git a/3.2.65/1026_linux-3.2.27.patch b/3.2.66/1026_linux-3.2.27.patch |
114 |
similarity index 100% |
115 |
rename from 3.2.65/1026_linux-3.2.27.patch |
116 |
rename to 3.2.66/1026_linux-3.2.27.patch |
117 |
|
118 |
diff --git a/3.2.65/1027_linux-3.2.28.patch b/3.2.66/1027_linux-3.2.28.patch |
119 |
similarity index 100% |
120 |
rename from 3.2.65/1027_linux-3.2.28.patch |
121 |
rename to 3.2.66/1027_linux-3.2.28.patch |
122 |
|
123 |
diff --git a/3.2.65/1028_linux-3.2.29.patch b/3.2.66/1028_linux-3.2.29.patch |
124 |
similarity index 100% |
125 |
rename from 3.2.65/1028_linux-3.2.29.patch |
126 |
rename to 3.2.66/1028_linux-3.2.29.patch |
127 |
|
128 |
diff --git a/3.2.65/1029_linux-3.2.30.patch b/3.2.66/1029_linux-3.2.30.patch |
129 |
similarity index 100% |
130 |
rename from 3.2.65/1029_linux-3.2.30.patch |
131 |
rename to 3.2.66/1029_linux-3.2.30.patch |
132 |
|
133 |
diff --git a/3.2.65/1030_linux-3.2.31.patch b/3.2.66/1030_linux-3.2.31.patch |
134 |
similarity index 100% |
135 |
rename from 3.2.65/1030_linux-3.2.31.patch |
136 |
rename to 3.2.66/1030_linux-3.2.31.patch |
137 |
|
138 |
diff --git a/3.2.65/1031_linux-3.2.32.patch b/3.2.66/1031_linux-3.2.32.patch |
139 |
similarity index 100% |
140 |
rename from 3.2.65/1031_linux-3.2.32.patch |
141 |
rename to 3.2.66/1031_linux-3.2.32.patch |
142 |
|
143 |
diff --git a/3.2.65/1032_linux-3.2.33.patch b/3.2.66/1032_linux-3.2.33.patch |
144 |
similarity index 100% |
145 |
rename from 3.2.65/1032_linux-3.2.33.patch |
146 |
rename to 3.2.66/1032_linux-3.2.33.patch |
147 |
|
148 |
diff --git a/3.2.65/1033_linux-3.2.34.patch b/3.2.66/1033_linux-3.2.34.patch |
149 |
similarity index 100% |
150 |
rename from 3.2.65/1033_linux-3.2.34.patch |
151 |
rename to 3.2.66/1033_linux-3.2.34.patch |
152 |
|
153 |
diff --git a/3.2.65/1034_linux-3.2.35.patch b/3.2.66/1034_linux-3.2.35.patch |
154 |
similarity index 100% |
155 |
rename from 3.2.65/1034_linux-3.2.35.patch |
156 |
rename to 3.2.66/1034_linux-3.2.35.patch |
157 |
|
158 |
diff --git a/3.2.65/1035_linux-3.2.36.patch b/3.2.66/1035_linux-3.2.36.patch |
159 |
similarity index 100% |
160 |
rename from 3.2.65/1035_linux-3.2.36.patch |
161 |
rename to 3.2.66/1035_linux-3.2.36.patch |
162 |
|
163 |
diff --git a/3.2.65/1036_linux-3.2.37.patch b/3.2.66/1036_linux-3.2.37.patch |
164 |
similarity index 100% |
165 |
rename from 3.2.65/1036_linux-3.2.37.patch |
166 |
rename to 3.2.66/1036_linux-3.2.37.patch |
167 |
|
168 |
diff --git a/3.2.65/1037_linux-3.2.38.patch b/3.2.66/1037_linux-3.2.38.patch |
169 |
similarity index 100% |
170 |
rename from 3.2.65/1037_linux-3.2.38.patch |
171 |
rename to 3.2.66/1037_linux-3.2.38.patch |
172 |
|
173 |
diff --git a/3.2.65/1038_linux-3.2.39.patch b/3.2.66/1038_linux-3.2.39.patch |
174 |
similarity index 100% |
175 |
rename from 3.2.65/1038_linux-3.2.39.patch |
176 |
rename to 3.2.66/1038_linux-3.2.39.patch |
177 |
|
178 |
diff --git a/3.2.65/1039_linux-3.2.40.patch b/3.2.66/1039_linux-3.2.40.patch |
179 |
similarity index 100% |
180 |
rename from 3.2.65/1039_linux-3.2.40.patch |
181 |
rename to 3.2.66/1039_linux-3.2.40.patch |
182 |
|
183 |
diff --git a/3.2.65/1040_linux-3.2.41.patch b/3.2.66/1040_linux-3.2.41.patch |
184 |
similarity index 100% |
185 |
rename from 3.2.65/1040_linux-3.2.41.patch |
186 |
rename to 3.2.66/1040_linux-3.2.41.patch |
187 |
|
188 |
diff --git a/3.2.65/1041_linux-3.2.42.patch b/3.2.66/1041_linux-3.2.42.patch |
189 |
similarity index 100% |
190 |
rename from 3.2.65/1041_linux-3.2.42.patch |
191 |
rename to 3.2.66/1041_linux-3.2.42.patch |
192 |
|
193 |
diff --git a/3.2.65/1042_linux-3.2.43.patch b/3.2.66/1042_linux-3.2.43.patch |
194 |
similarity index 100% |
195 |
rename from 3.2.65/1042_linux-3.2.43.patch |
196 |
rename to 3.2.66/1042_linux-3.2.43.patch |
197 |
|
198 |
diff --git a/3.2.65/1043_linux-3.2.44.patch b/3.2.66/1043_linux-3.2.44.patch |
199 |
similarity index 100% |
200 |
rename from 3.2.65/1043_linux-3.2.44.patch |
201 |
rename to 3.2.66/1043_linux-3.2.44.patch |
202 |
|
203 |
diff --git a/3.2.65/1044_linux-3.2.45.patch b/3.2.66/1044_linux-3.2.45.patch |
204 |
similarity index 100% |
205 |
rename from 3.2.65/1044_linux-3.2.45.patch |
206 |
rename to 3.2.66/1044_linux-3.2.45.patch |
207 |
|
208 |
diff --git a/3.2.65/1045_linux-3.2.46.patch b/3.2.66/1045_linux-3.2.46.patch |
209 |
similarity index 100% |
210 |
rename from 3.2.65/1045_linux-3.2.46.patch |
211 |
rename to 3.2.66/1045_linux-3.2.46.patch |
212 |
|
213 |
diff --git a/3.2.65/1046_linux-3.2.47.patch b/3.2.66/1046_linux-3.2.47.patch |
214 |
similarity index 100% |
215 |
rename from 3.2.65/1046_linux-3.2.47.patch |
216 |
rename to 3.2.66/1046_linux-3.2.47.patch |
217 |
|
218 |
diff --git a/3.2.65/1047_linux-3.2.48.patch b/3.2.66/1047_linux-3.2.48.patch |
219 |
similarity index 100% |
220 |
rename from 3.2.65/1047_linux-3.2.48.patch |
221 |
rename to 3.2.66/1047_linux-3.2.48.patch |
222 |
|
223 |
diff --git a/3.2.65/1048_linux-3.2.49.patch b/3.2.66/1048_linux-3.2.49.patch |
224 |
similarity index 100% |
225 |
rename from 3.2.65/1048_linux-3.2.49.patch |
226 |
rename to 3.2.66/1048_linux-3.2.49.patch |
227 |
|
228 |
diff --git a/3.2.65/1049_linux-3.2.50.patch b/3.2.66/1049_linux-3.2.50.patch |
229 |
similarity index 100% |
230 |
rename from 3.2.65/1049_linux-3.2.50.patch |
231 |
rename to 3.2.66/1049_linux-3.2.50.patch |
232 |
|
233 |
diff --git a/3.2.65/1050_linux-3.2.51.patch b/3.2.66/1050_linux-3.2.51.patch |
234 |
similarity index 100% |
235 |
rename from 3.2.65/1050_linux-3.2.51.patch |
236 |
rename to 3.2.66/1050_linux-3.2.51.patch |
237 |
|
238 |
diff --git a/3.2.65/1051_linux-3.2.52.patch b/3.2.66/1051_linux-3.2.52.patch |
239 |
similarity index 100% |
240 |
rename from 3.2.65/1051_linux-3.2.52.patch |
241 |
rename to 3.2.66/1051_linux-3.2.52.patch |
242 |
|
243 |
diff --git a/3.2.65/1052_linux-3.2.53.patch b/3.2.66/1052_linux-3.2.53.patch |
244 |
similarity index 100% |
245 |
rename from 3.2.65/1052_linux-3.2.53.patch |
246 |
rename to 3.2.66/1052_linux-3.2.53.patch |
247 |
|
248 |
diff --git a/3.2.65/1053_linux-3.2.54.patch b/3.2.66/1053_linux-3.2.54.patch |
249 |
similarity index 100% |
250 |
rename from 3.2.65/1053_linux-3.2.54.patch |
251 |
rename to 3.2.66/1053_linux-3.2.54.patch |
252 |
|
253 |
diff --git a/3.2.65/1054_linux-3.2.55.patch b/3.2.66/1054_linux-3.2.55.patch |
254 |
similarity index 100% |
255 |
rename from 3.2.65/1054_linux-3.2.55.patch |
256 |
rename to 3.2.66/1054_linux-3.2.55.patch |
257 |
|
258 |
diff --git a/3.2.65/1055_linux-3.2.56.patch b/3.2.66/1055_linux-3.2.56.patch |
259 |
similarity index 100% |
260 |
rename from 3.2.65/1055_linux-3.2.56.patch |
261 |
rename to 3.2.66/1055_linux-3.2.56.patch |
262 |
|
263 |
diff --git a/3.2.65/1056_linux-3.2.57.patch b/3.2.66/1056_linux-3.2.57.patch |
264 |
similarity index 100% |
265 |
rename from 3.2.65/1056_linux-3.2.57.patch |
266 |
rename to 3.2.66/1056_linux-3.2.57.patch |
267 |
|
268 |
diff --git a/3.2.65/1057_linux-3.2.58.patch b/3.2.66/1057_linux-3.2.58.patch |
269 |
similarity index 100% |
270 |
rename from 3.2.65/1057_linux-3.2.58.patch |
271 |
rename to 3.2.66/1057_linux-3.2.58.patch |
272 |
|
273 |
diff --git a/3.2.65/1058_linux-3.2.59.patch b/3.2.66/1058_linux-3.2.59.patch |
274 |
similarity index 100% |
275 |
rename from 3.2.65/1058_linux-3.2.59.patch |
276 |
rename to 3.2.66/1058_linux-3.2.59.patch |
277 |
|
278 |
diff --git a/3.2.65/1059_linux-3.2.60.patch b/3.2.66/1059_linux-3.2.60.patch |
279 |
similarity index 100% |
280 |
rename from 3.2.65/1059_linux-3.2.60.patch |
281 |
rename to 3.2.66/1059_linux-3.2.60.patch |
282 |
|
283 |
diff --git a/3.2.65/1060_linux-3.2.61.patch b/3.2.66/1060_linux-3.2.61.patch |
284 |
similarity index 100% |
285 |
rename from 3.2.65/1060_linux-3.2.61.patch |
286 |
rename to 3.2.66/1060_linux-3.2.61.patch |
287 |
|
288 |
diff --git a/3.2.65/1061_linux-3.2.62.patch b/3.2.66/1061_linux-3.2.62.patch |
289 |
similarity index 100% |
290 |
rename from 3.2.65/1061_linux-3.2.62.patch |
291 |
rename to 3.2.66/1061_linux-3.2.62.patch |
292 |
|
293 |
diff --git a/3.2.65/1062_linux-3.2.63.patch b/3.2.66/1062_linux-3.2.63.patch |
294 |
similarity index 100% |
295 |
rename from 3.2.65/1062_linux-3.2.63.patch |
296 |
rename to 3.2.66/1062_linux-3.2.63.patch |
297 |
|
298 |
diff --git a/3.2.65/1063_linux-3.2.64.patch b/3.2.66/1063_linux-3.2.64.patch |
299 |
similarity index 100% |
300 |
rename from 3.2.65/1063_linux-3.2.64.patch |
301 |
rename to 3.2.66/1063_linux-3.2.64.patch |
302 |
|
303 |
diff --git a/3.2.65/1064_linux-3.2.65.patch b/3.2.66/1064_linux-3.2.65.patch |
304 |
similarity index 100% |
305 |
rename from 3.2.65/1064_linux-3.2.65.patch |
306 |
rename to 3.2.66/1064_linux-3.2.65.patch |
307 |
|
308 |
diff --git a/3.2.66/1065_linux-3.2.66.patch b/3.2.66/1065_linux-3.2.66.patch |
309 |
new file mode 100644 |
310 |
index 0000000..73fa646 |
311 |
--- /dev/null |
312 |
+++ b/3.2.66/1065_linux-3.2.66.patch |
313 |
@@ -0,0 +1,2041 @@ |
314 |
+diff --git a/Makefile b/Makefile |
315 |
+index 1433109..f08f8bf 100644 |
316 |
+--- a/Makefile |
317 |
++++ b/Makefile |
318 |
+@@ -1,6 +1,6 @@ |
319 |
+ VERSION = 3 |
320 |
+ PATCHLEVEL = 2 |
321 |
+-SUBLEVEL = 65 |
322 |
++SUBLEVEL = 66 |
323 |
+ EXTRAVERSION = |
324 |
+ NAME = Saber-toothed Squirrel |
325 |
+ |
326 |
+diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c |
327 |
+index 70ec4e9..941d5cb 100644 |
328 |
+--- a/arch/powerpc/platforms/cell/spufs/inode.c |
329 |
++++ b/arch/powerpc/platforms/cell/spufs/inode.c |
330 |
+@@ -165,7 +165,7 @@ static void spufs_prune_dir(struct dentry *dir) |
331 |
+ struct dentry *dentry, *tmp; |
332 |
+ |
333 |
+ mutex_lock(&dir->d_inode->i_mutex); |
334 |
+- list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) { |
335 |
++ list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) { |
336 |
+ spin_lock(&dentry->d_lock); |
337 |
+ if (!(d_unhashed(dentry)) && dentry->d_inode) { |
338 |
+ dget_dlock(dentry); |
339 |
+@@ -223,7 +223,7 @@ out: |
340 |
+ * - free child's inode if possible |
341 |
+ * - free child |
342 |
+ */ |
343 |
+- list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) { |
344 |
++ list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) { |
345 |
+ dput(dentry); |
346 |
+ } |
347 |
+ |
348 |
+diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c |
349 |
+index b2f44de..fd65e5e2 100644 |
350 |
+--- a/arch/s390/kernel/time.c |
351 |
++++ b/arch/s390/kernel/time.c |
352 |
+@@ -110,20 +110,10 @@ static void fixup_clock_comparator(unsigned long long delta) |
353 |
+ set_clock_comparator(S390_lowcore.clock_comparator); |
354 |
+ } |
355 |
+ |
356 |
+-static int s390_next_ktime(ktime_t expires, |
357 |
++static int s390_next_event(unsigned long delta, |
358 |
+ struct clock_event_device *evt) |
359 |
+ { |
360 |
+- struct timespec ts; |
361 |
+- u64 nsecs; |
362 |
+- |
363 |
+- ts.tv_sec = ts.tv_nsec = 0; |
364 |
+- monotonic_to_bootbased(&ts); |
365 |
+- nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires)); |
366 |
+- do_div(nsecs, 125); |
367 |
+- S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9); |
368 |
+- /* Program the maximum value if we have an overflow (== year 2042) */ |
369 |
+- if (unlikely(S390_lowcore.clock_comparator < sched_clock_base_cc)) |
370 |
+- S390_lowcore.clock_comparator = -1ULL; |
371 |
++ S390_lowcore.clock_comparator = get_clock() + delta; |
372 |
+ set_clock_comparator(S390_lowcore.clock_comparator); |
373 |
+ return 0; |
374 |
+ } |
375 |
+@@ -148,15 +138,14 @@ void init_cpu_timer(void) |
376 |
+ cpu = smp_processor_id(); |
377 |
+ cd = &per_cpu(comparators, cpu); |
378 |
+ cd->name = "comparator"; |
379 |
+- cd->features = CLOCK_EVT_FEAT_ONESHOT | |
380 |
+- CLOCK_EVT_FEAT_KTIME; |
381 |
++ cd->features = CLOCK_EVT_FEAT_ONESHOT; |
382 |
+ cd->mult = 16777; |
383 |
+ cd->shift = 12; |
384 |
+ cd->min_delta_ns = 1; |
385 |
+ cd->max_delta_ns = LONG_MAX; |
386 |
+ cd->rating = 400; |
387 |
+ cd->cpumask = cpumask_of(cpu); |
388 |
+- cd->set_next_ktime = s390_next_ktime; |
389 |
++ cd->set_next_event = s390_next_event; |
390 |
+ cd->set_mode = s390_set_mode; |
391 |
+ |
392 |
+ clockevents_register_device(cd); |
393 |
+diff --git a/arch/x86/crypto/ghash-clmulni-intel_asm.S b/arch/x86/crypto/ghash-clmulni-intel_asm.S |
394 |
+index 1eb7f90..eb4d2a2 100644 |
395 |
+--- a/arch/x86/crypto/ghash-clmulni-intel_asm.S |
396 |
++++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S |
397 |
+@@ -24,10 +24,6 @@ |
398 |
+ .align 16 |
399 |
+ .Lbswap_mask: |
400 |
+ .octa 0x000102030405060708090a0b0c0d0e0f |
401 |
+-.Lpoly: |
402 |
+- .octa 0xc2000000000000000000000000000001 |
403 |
+-.Ltwo_one: |
404 |
+- .octa 0x00000001000000000000000000000001 |
405 |
+ |
406 |
+ #define DATA %xmm0 |
407 |
+ #define SHASH %xmm1 |
408 |
+@@ -131,27 +127,3 @@ ENTRY(clmul_ghash_update) |
409 |
+ movups DATA, (%rdi) |
410 |
+ .Lupdate_just_ret: |
411 |
+ ret |
412 |
+- |
413 |
+-/* |
414 |
+- * void clmul_ghash_setkey(be128 *shash, const u8 *key); |
415 |
+- * |
416 |
+- * Calculate hash_key << 1 mod poly |
417 |
+- */ |
418 |
+-ENTRY(clmul_ghash_setkey) |
419 |
+- movaps .Lbswap_mask, BSWAP |
420 |
+- movups (%rsi), %xmm0 |
421 |
+- PSHUFB_XMM BSWAP %xmm0 |
422 |
+- movaps %xmm0, %xmm1 |
423 |
+- psllq $1, %xmm0 |
424 |
+- psrlq $63, %xmm1 |
425 |
+- movaps %xmm1, %xmm2 |
426 |
+- pslldq $8, %xmm1 |
427 |
+- psrldq $8, %xmm2 |
428 |
+- por %xmm1, %xmm0 |
429 |
+- # reduction |
430 |
+- pshufd $0b00100100, %xmm2, %xmm1 |
431 |
+- pcmpeqd .Ltwo_one, %xmm1 |
432 |
+- pand .Lpoly, %xmm1 |
433 |
+- pxor %xmm1, %xmm0 |
434 |
+- movups %xmm0, (%rdi) |
435 |
+- ret |
436 |
+diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c |
437 |
+index 976aa64..294a264 100644 |
438 |
+--- a/arch/x86/crypto/ghash-clmulni-intel_glue.c |
439 |
++++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c |
440 |
+@@ -29,8 +29,6 @@ void clmul_ghash_mul(char *dst, const be128 *shash); |
441 |
+ void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, |
442 |
+ const be128 *shash); |
443 |
+ |
444 |
+-void clmul_ghash_setkey(be128 *shash, const u8 *key); |
445 |
+- |
446 |
+ struct ghash_async_ctx { |
447 |
+ struct cryptd_ahash *cryptd_tfm; |
448 |
+ }; |
449 |
+@@ -57,13 +55,23 @@ static int ghash_setkey(struct crypto_shash *tfm, |
450 |
+ const u8 *key, unsigned int keylen) |
451 |
+ { |
452 |
+ struct ghash_ctx *ctx = crypto_shash_ctx(tfm); |
453 |
++ be128 *x = (be128 *)key; |
454 |
++ u64 a, b; |
455 |
+ |
456 |
+ if (keylen != GHASH_BLOCK_SIZE) { |
457 |
+ crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); |
458 |
+ return -EINVAL; |
459 |
+ } |
460 |
+ |
461 |
+- clmul_ghash_setkey(&ctx->shash, key); |
462 |
++ /* perform multiplication by 'x' in GF(2^128) */ |
463 |
++ a = be64_to_cpu(x->a); |
464 |
++ b = be64_to_cpu(x->b); |
465 |
++ |
466 |
++ ctx->shash.a = (__be64)((b << 1) | (a >> 63)); |
467 |
++ ctx->shash.b = (__be64)((a << 1) | (b >> 63)); |
468 |
++ |
469 |
++ if (a >> 63) |
470 |
++ ctx->shash.b ^= cpu_to_be64(0xc2); |
471 |
+ |
472 |
+ return 0; |
473 |
+ } |
474 |
+diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h |
475 |
+index a315f1c..b8a5fe5 100644 |
476 |
+--- a/arch/x86/include/asm/cpufeature.h |
477 |
++++ b/arch/x86/include/asm/cpufeature.h |
478 |
+@@ -193,6 +193,7 @@ |
479 |
+ #define X86_FEATURE_DECODEASSISTS (8*32+12) /* AMD Decode Assists support */ |
480 |
+ #define X86_FEATURE_PAUSEFILTER (8*32+13) /* AMD filtered pause intercept */ |
481 |
+ #define X86_FEATURE_PFTHRESHOLD (8*32+14) /* AMD pause filter threshold */ |
482 |
++#define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer vmmcall to vmcall */ |
483 |
+ |
484 |
+ |
485 |
+ /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */ |
486 |
+diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h |
487 |
+index 734c376..9f0a680 100644 |
488 |
+--- a/arch/x86/include/asm/kvm_para.h |
489 |
++++ b/arch/x86/include/asm/kvm_para.h |
490 |
+@@ -91,15 +91,21 @@ struct kvm_vcpu_pv_apf_data { |
491 |
+ |
492 |
+ #ifdef __KERNEL__ |
493 |
+ #include <asm/processor.h> |
494 |
++#include <asm/alternative.h> |
495 |
+ |
496 |
+ extern void kvmclock_init(void); |
497 |
+ extern int kvm_register_clock(char *txt); |
498 |
+ |
499 |
+ |
500 |
+-/* This instruction is vmcall. On non-VT architectures, it will generate a |
501 |
+- * trap that we will then rewrite to the appropriate instruction. |
502 |
++#ifdef CONFIG_DEBUG_RODATA |
503 |
++#define KVM_HYPERCALL \ |
504 |
++ ALTERNATIVE(".byte 0x0f,0x01,0xc1", ".byte 0x0f,0x01,0xd9", X86_FEATURE_VMMCALL) |
505 |
++#else |
506 |
++/* On AMD processors, vmcall will generate a trap that we will |
507 |
++ * then rewrite to the appropriate instruction. |
508 |
+ */ |
509 |
+ #define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1" |
510 |
++#endif |
511 |
+ |
512 |
+ /* For KVM hypercalls, a three-byte sequence of either the vmrun or the vmmrun |
513 |
+ * instruction. The hypervisor may replace it with something else but only the |
514 |
+diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c |
515 |
+index f07becc..2d44a28 100644 |
516 |
+--- a/arch/x86/kernel/cpu/amd.c |
517 |
++++ b/arch/x86/kernel/cpu/amd.c |
518 |
+@@ -469,6 +469,13 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) |
519 |
+ set_cpu_cap(c, X86_FEATURE_EXTD_APICID); |
520 |
+ } |
521 |
+ #endif |
522 |
++ |
523 |
++ /* |
524 |
++ * This is only needed to tell the kernel whether to use VMCALL |
525 |
++ * and VMMCALL. VMMCALL is never executed except under virt, so |
526 |
++ * we can set it unconditionally. |
527 |
++ */ |
528 |
++ set_cpu_cap(c, X86_FEATURE_VMMCALL); |
529 |
+ } |
530 |
+ |
531 |
+ static void __cpuinit init_amd(struct cpuinfo_x86 *c) |
532 |
+diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c |
533 |
+index a9c2116..4b6701e 100644 |
534 |
+--- a/arch/x86/kernel/kvm.c |
535 |
++++ b/arch/x86/kernel/kvm.c |
536 |
+@@ -419,7 +419,14 @@ static void kvm_leave_lazy_mmu(void) |
537 |
+ static void __init paravirt_ops_setup(void) |
538 |
+ { |
539 |
+ pv_info.name = "KVM"; |
540 |
+- pv_info.paravirt_enabled = 1; |
541 |
++ |
542 |
++ /* |
543 |
++ * KVM isn't paravirt in the sense of paravirt_enabled. A KVM |
544 |
++ * guest kernel works like a bare metal kernel with additional |
545 |
++ * features, and paravirt_enabled is about features that are |
546 |
++ * missing. |
547 |
++ */ |
548 |
++ pv_info.paravirt_enabled = 0; |
549 |
+ |
550 |
+ if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY)) |
551 |
+ pv_cpu_ops.io_delay = kvm_io_delay; |
552 |
+diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c |
553 |
+index 44842d7..e90eca0 100644 |
554 |
+--- a/arch/x86/kernel/kvmclock.c |
555 |
++++ b/arch/x86/kernel/kvmclock.c |
556 |
+@@ -203,7 +203,6 @@ void __init kvmclock_init(void) |
557 |
+ #endif |
558 |
+ kvm_get_preset_lpj(); |
559 |
+ clocksource_register_hz(&kvm_clock, NSEC_PER_SEC); |
560 |
+- pv_info.paravirt_enabled = 1; |
561 |
+ pv_info.name = "KVM"; |
562 |
+ |
563 |
+ if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE_STABLE_BIT)) |
564 |
+diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c |
565 |
+index bcfec2d..7af7338 100644 |
566 |
+--- a/arch/x86/kernel/tls.c |
567 |
++++ b/arch/x86/kernel/tls.c |
568 |
+@@ -28,6 +28,21 @@ static int get_free_idx(void) |
569 |
+ return -ESRCH; |
570 |
+ } |
571 |
+ |
572 |
++static bool tls_desc_okay(const struct user_desc *info) |
573 |
++{ |
574 |
++ if (LDT_empty(info)) |
575 |
++ return true; |
576 |
++ |
577 |
++ /* |
578 |
++ * espfix is required for 16-bit data segments, but espfix |
579 |
++ * only works for LDT segments. |
580 |
++ */ |
581 |
++ if (!info->seg_32bit) |
582 |
++ return false; |
583 |
++ |
584 |
++ return true; |
585 |
++} |
586 |
++ |
587 |
+ static void set_tls_desc(struct task_struct *p, int idx, |
588 |
+ const struct user_desc *info, int n) |
589 |
+ { |
590 |
+@@ -67,6 +82,9 @@ int do_set_thread_area(struct task_struct *p, int idx, |
591 |
+ if (copy_from_user(&info, u_info, sizeof(info))) |
592 |
+ return -EFAULT; |
593 |
+ |
594 |
++ if (!tls_desc_okay(&info)) |
595 |
++ return -EINVAL; |
596 |
++ |
597 |
+ if (idx == -1) |
598 |
+ idx = info.entry_number; |
599 |
+ |
600 |
+@@ -197,6 +215,7 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset, |
601 |
+ { |
602 |
+ struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES]; |
603 |
+ const struct user_desc *info; |
604 |
++ int i; |
605 |
+ |
606 |
+ if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || |
607 |
+ (pos % sizeof(struct user_desc)) != 0 || |
608 |
+@@ -210,6 +229,10 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset, |
609 |
+ else |
610 |
+ info = infobuf; |
611 |
+ |
612 |
++ for (i = 0; i < count / sizeof(struct user_desc); i++) |
613 |
++ if (!tls_desc_okay(info + i)) |
614 |
++ return -EINVAL; |
615 |
++ |
616 |
+ set_tls_desc(target, |
617 |
+ GDT_ENTRY_TLS_MIN + (pos / sizeof(struct user_desc)), |
618 |
+ info, count / sizeof(struct user_desc)); |
619 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
620 |
+index 2d7d0df..bb179cc 100644 |
621 |
+--- a/arch/x86/kvm/x86.c |
622 |
++++ b/arch/x86/kvm/x86.c |
623 |
+@@ -4846,7 +4846,7 @@ static int handle_emulation_failure(struct kvm_vcpu *vcpu) |
624 |
+ |
625 |
+ ++vcpu->stat.insn_emulation_fail; |
626 |
+ trace_kvm_emulate_insn_failed(vcpu); |
627 |
+- if (!is_guest_mode(vcpu)) { |
628 |
++ if (!is_guest_mode(vcpu) && kvm_x86_ops->get_cpl(vcpu) == 0) { |
629 |
+ vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; |
630 |
+ vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION; |
631 |
+ vcpu->run->internal.ndata = 0; |
632 |
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c |
633 |
+index 923ac15..81f32e5 100644 |
634 |
+--- a/drivers/ata/ahci.c |
635 |
++++ b/drivers/ata/ahci.c |
636 |
+@@ -331,6 +331,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { |
637 |
+ { PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series RAID */ |
638 |
+ { PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */ |
639 |
+ { PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series RAID */ |
640 |
++ { PCI_VDEVICE(INTEL, 0x9d03), board_ahci }, /* Sunrise Point-LP AHCI */ |
641 |
++ { PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */ |
642 |
++ { PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */ |
643 |
+ { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */ |
644 |
+ { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */ |
645 |
+ { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */ |
646 |
+@@ -499,6 +502,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { |
647 |
+ * enabled. https://bugzilla.kernel.org/show_bug.cgi?id=60731 |
648 |
+ */ |
649 |
+ { PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_nomsi }, |
650 |
++ { PCI_VDEVICE(SAMSUNG, 0xa800), board_ahci_nomsi }, |
651 |
+ |
652 |
+ /* Enmotus */ |
653 |
+ { PCI_DEVICE(0x1c44, 0x8000), board_ahci }, |
654 |
+diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c |
655 |
+index 78ae7b6..54702f8 100644 |
656 |
+--- a/drivers/ata/sata_fsl.c |
657 |
++++ b/drivers/ata/sata_fsl.c |
658 |
+@@ -1338,7 +1338,7 @@ static int sata_fsl_probe(struct platform_device *ofdev) |
659 |
+ host_priv->csr_base = csr_base; |
660 |
+ |
661 |
+ irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); |
662 |
+- if (irq < 0) { |
663 |
++ if (!irq) { |
664 |
+ dev_err(&ofdev->dev, "invalid irq from platform\n"); |
665 |
+ goto error_exit_with_cleanup; |
666 |
+ } |
667 |
+diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c |
668 |
+index 3f1799b..09851ce 100644 |
669 |
+--- a/drivers/gpu/drm/drm_crtc.c |
670 |
++++ b/drivers/gpu/drm/drm_crtc.c |
671 |
+@@ -1815,7 +1815,17 @@ int drm_mode_getfb(struct drm_device *dev, |
672 |
+ r->depth = fb->depth; |
673 |
+ r->bpp = fb->bits_per_pixel; |
674 |
+ r->pitch = fb->pitch; |
675 |
+- fb->funcs->create_handle(fb, file_priv, &r->handle); |
676 |
++ if (file_priv->is_master || capable(CAP_SYS_ADMIN)) { |
677 |
++ ret = fb->funcs->create_handle(fb, file_priv, &r->handle); |
678 |
++ } else { |
679 |
++ /* GET_FB() is an unprivileged ioctl so we must not |
680 |
++ * return a buffer-handle to non-master processes! For |
681 |
++ * backwards-compatibility reasons, we cannot make |
682 |
++ * GET_FB() privileged, so just return an invalid handle |
683 |
++ * for non-masters. */ |
684 |
++ r->handle = 0; |
685 |
++ ret = 0; |
686 |
++ } |
687 |
+ |
688 |
+ out: |
689 |
+ mutex_unlock(&dev->mode_config.mutex); |
690 |
+diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c |
691 |
+index fadd021..4da8182 100644 |
692 |
+--- a/drivers/gpu/drm/i915/intel_lvds.c |
693 |
++++ b/drivers/gpu/drm/i915/intel_lvds.c |
694 |
+@@ -914,6 +914,18 @@ bool intel_lvds_init(struct drm_device *dev) |
695 |
+ int pipe; |
696 |
+ u8 pin; |
697 |
+ |
698 |
++ /* |
699 |
++ * Unlock registers and just leave them unlocked. Do this before |
700 |
++ * checking quirk lists to avoid bogus WARNINGs. |
701 |
++ */ |
702 |
++ if (HAS_PCH_SPLIT(dev)) { |
703 |
++ I915_WRITE(PCH_PP_CONTROL, |
704 |
++ I915_READ(PCH_PP_CONTROL) | PANEL_UNLOCK_REGS); |
705 |
++ } else { |
706 |
++ I915_WRITE(PP_CONTROL, |
707 |
++ I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS); |
708 |
++ } |
709 |
++ |
710 |
+ /* Skip init on machines we know falsely report LVDS */ |
711 |
+ if (dmi_check_system(intel_no_lvds)) |
712 |
+ return false; |
713 |
+@@ -1088,19 +1100,6 @@ out: |
714 |
+ pwm = I915_READ(BLC_PWM_PCH_CTL1); |
715 |
+ pwm |= PWM_PCH_ENABLE; |
716 |
+ I915_WRITE(BLC_PWM_PCH_CTL1, pwm); |
717 |
+- /* |
718 |
+- * Unlock registers and just |
719 |
+- * leave them unlocked |
720 |
+- */ |
721 |
+- I915_WRITE(PCH_PP_CONTROL, |
722 |
+- I915_READ(PCH_PP_CONTROL) | PANEL_UNLOCK_REGS); |
723 |
+- } else { |
724 |
+- /* |
725 |
+- * Unlock registers and just |
726 |
+- * leave them unlocked |
727 |
+- */ |
728 |
+- I915_WRITE(PP_CONTROL, |
729 |
+- I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS); |
730 |
+ } |
731 |
+ dev_priv->lid_notifier.notifier_call = intel_lid_notify; |
732 |
+ if (acpi_lid_notifier_register(&dev_priv->lid_notifier)) { |
733 |
+diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c |
734 |
+index 79b4bcb..1837fe6 100644 |
735 |
+--- a/drivers/i2c/busses/i2c-davinci.c |
736 |
++++ b/drivers/i2c/busses/i2c-davinci.c |
737 |
+@@ -416,11 +416,9 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) |
738 |
+ if (dev->cmd_err & DAVINCI_I2C_STR_NACK) { |
739 |
+ if (msg->flags & I2C_M_IGNORE_NAK) |
740 |
+ return msg->len; |
741 |
+- if (stop) { |
742 |
+- w = davinci_i2c_read_reg(dev, DAVINCI_I2C_MDR_REG); |
743 |
+- w |= DAVINCI_I2C_MDR_STP; |
744 |
+- davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w); |
745 |
+- } |
746 |
++ w = davinci_i2c_read_reg(dev, DAVINCI_I2C_MDR_REG); |
747 |
++ w |= DAVINCI_I2C_MDR_STP; |
748 |
++ davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w); |
749 |
+ return -EREMOTEIO; |
750 |
+ } |
751 |
+ return -EIO; |
752 |
+diff --git a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c |
753 |
+index 21260aa..852870b 100644 |
754 |
+--- a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c |
755 |
++++ b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c |
756 |
+@@ -154,6 +154,9 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc |
757 |
+ 0x00, 0x00, 0x00, 0x00, |
758 |
+ 0x00, 0x00 }; |
759 |
+ |
760 |
++ if (cmd->msg_len > sizeof(b) - 4) |
761 |
++ return -EINVAL; |
762 |
++ |
763 |
+ memcpy(&b[4], cmd->msg, cmd->msg_len); |
764 |
+ |
765 |
+ state->config->send_command(fe, 0x72, |
766 |
+diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig |
767 |
+index 654a5e9..61d3d1f 100644 |
768 |
+--- a/drivers/net/Kconfig |
769 |
++++ b/drivers/net/Kconfig |
770 |
+@@ -143,6 +143,7 @@ config MACVLAN |
771 |
+ config MACVTAP |
772 |
+ tristate "MAC-VLAN based tap driver (EXPERIMENTAL)" |
773 |
+ depends on MACVLAN |
774 |
++ depends on INET |
775 |
+ help |
776 |
+ This adds a specialized tap character device driver that is based |
777 |
+ on the MAC-VLAN network interface, called macvtap. A macvtap device |
778 |
+@@ -195,6 +196,7 @@ config RIONET_RX_SIZE |
779 |
+ |
780 |
+ config TUN |
781 |
+ tristate "Universal TUN/TAP device driver support" |
782 |
++ depends on INET |
783 |
+ select CRC32 |
784 |
+ ---help--- |
785 |
+ TUN/TAP provides packet reception and transmission for user space |
786 |
+diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c |
787 |
+index b0f9015..0e6e57e 100644 |
788 |
+--- a/drivers/net/macvtap.c |
789 |
++++ b/drivers/net/macvtap.c |
790 |
+@@ -15,6 +15,7 @@ |
791 |
+ #include <linux/cdev.h> |
792 |
+ #include <linux/fs.h> |
793 |
+ |
794 |
++#include <net/ipv6.h> |
795 |
+ #include <net/net_namespace.h> |
796 |
+ #include <net/rtnetlink.h> |
797 |
+ #include <net/sock.h> |
798 |
+@@ -577,6 +578,8 @@ static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb, |
799 |
+ break; |
800 |
+ case VIRTIO_NET_HDR_GSO_UDP: |
801 |
+ gso_type = SKB_GSO_UDP; |
802 |
++ if (skb->protocol == htons(ETH_P_IPV6)) |
803 |
++ ipv6_proxy_select_ident(skb); |
804 |
+ break; |
805 |
+ default: |
806 |
+ return -EINVAL; |
807 |
+diff --git a/drivers/net/tun.c b/drivers/net/tun.c |
808 |
+index ee1aab0..2fbbca6 100644 |
809 |
+--- a/drivers/net/tun.c |
810 |
++++ b/drivers/net/tun.c |
811 |
+@@ -64,6 +64,7 @@ |
812 |
+ #include <linux/nsproxy.h> |
813 |
+ #include <linux/virtio_net.h> |
814 |
+ #include <linux/rcupdate.h> |
815 |
++#include <net/ipv6.h> |
816 |
+ #include <net/net_namespace.h> |
817 |
+ #include <net/netns/generic.h> |
818 |
+ #include <net/rtnetlink.h> |
819 |
+@@ -695,6 +696,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, |
820 |
+ break; |
821 |
+ } |
822 |
+ |
823 |
++ skb_reset_network_header(skb); |
824 |
++ |
825 |
+ if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) { |
826 |
+ pr_debug("GSO!\n"); |
827 |
+ switch (gso.gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { |
828 |
+@@ -706,6 +709,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, |
829 |
+ break; |
830 |
+ case VIRTIO_NET_HDR_GSO_UDP: |
831 |
+ skb_shinfo(skb)->gso_type = SKB_GSO_UDP; |
832 |
++ if (skb->protocol == htons(ETH_P_IPV6)) |
833 |
++ ipv6_proxy_select_ident(skb); |
834 |
+ break; |
835 |
+ default: |
836 |
+ tun->dev->stats.rx_frame_errors++; |
837 |
+diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c |
838 |
+index 2278dad..5babd94 100644 |
839 |
+--- a/drivers/usb/core/inode.c |
840 |
++++ b/drivers/usb/core/inode.c |
841 |
+@@ -212,7 +212,7 @@ static void update_bus(struct dentry *bus) |
842 |
+ |
843 |
+ mutex_lock(&bus->d_inode->i_mutex); |
844 |
+ |
845 |
+- list_for_each_entry(dev, &bus->d_subdirs, d_u.d_child) |
846 |
++ list_for_each_entry(dev, &bus->d_subdirs, d_child) |
847 |
+ if (dev->d_inode) |
848 |
+ update_dev(dev); |
849 |
+ |
850 |
+@@ -229,7 +229,7 @@ static void update_sb(struct super_block *sb) |
851 |
+ |
852 |
+ mutex_lock_nested(&root->d_inode->i_mutex, I_MUTEX_PARENT); |
853 |
+ |
854 |
+- list_for_each_entry(bus, &root->d_subdirs, d_u.d_child) { |
855 |
++ list_for_each_entry(bus, &root->d_subdirs, d_child) { |
856 |
+ if (bus->d_inode) { |
857 |
+ switch (S_IFMT & bus->d_inode->i_mode) { |
858 |
+ case S_IFDIR: |
859 |
+@@ -345,7 +345,7 @@ static int usbfs_empty (struct dentry *dentry) |
860 |
+ |
861 |
+ spin_lock(&dentry->d_lock); |
862 |
+ list_for_each(list, &dentry->d_subdirs) { |
863 |
+- struct dentry *de = list_entry(list, struct dentry, d_u.d_child); |
864 |
++ struct dentry *de = list_entry(list, struct dentry, d_child); |
865 |
+ |
866 |
+ spin_lock_nested(&de->d_lock, DENTRY_D_LOCK_NESTED); |
867 |
+ if (usbfs_positive(de)) { |
868 |
+diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c |
869 |
+index 0b5745e..30d4fa8 100644 |
870 |
+--- a/fs/9p/vfs_inode_dotl.c |
871 |
++++ b/fs/9p/vfs_inode_dotl.c |
872 |
+@@ -81,7 +81,7 @@ static struct dentry *v9fs_dentry_from_dir_inode(struct inode *inode) |
873 |
+ spin_lock(&inode->i_lock); |
874 |
+ /* Directory should have only one entry. */ |
875 |
+ BUG_ON(S_ISDIR(inode->i_mode) && !list_is_singular(&inode->i_dentry)); |
876 |
+- dentry = list_entry(inode->i_dentry.next, struct dentry, d_alias); |
877 |
++ dentry = list_entry(inode->i_dentry.next, struct dentry, d_u.d_alias); |
878 |
+ spin_unlock(&inode->i_lock); |
879 |
+ return dentry; |
880 |
+ } |
881 |
+diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c |
882 |
+index de37ec8..43c05d8 100644 |
883 |
+--- a/fs/affs/amigaffs.c |
884 |
++++ b/fs/affs/amigaffs.c |
885 |
+@@ -132,7 +132,7 @@ affs_fix_dcache(struct dentry *dentry, u32 entry_ino) |
886 |
+ head = &inode->i_dentry; |
887 |
+ next = head->next; |
888 |
+ while (next != head) { |
889 |
+- dentry = list_entry(next, struct dentry, d_alias); |
890 |
++ dentry = list_entry(next, struct dentry, d_u.d_alias); |
891 |
+ if (entry_ino == (u32)(long)dentry->d_fsdata) { |
892 |
+ dentry->d_fsdata = data; |
893 |
+ break; |
894 |
+diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c |
895 |
+index 2c69d12..7fc0371 100644 |
896 |
+--- a/fs/autofs4/expire.c |
897 |
++++ b/fs/autofs4/expire.c |
898 |
+@@ -100,7 +100,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev, |
899 |
+ p = prev; |
900 |
+ spin_lock(&p->d_lock); |
901 |
+ again: |
902 |
+- next = p->d_u.d_child.next; |
903 |
++ next = p->d_child.next; |
904 |
+ start: |
905 |
+ if (next == &root->d_subdirs) { |
906 |
+ spin_unlock(&p->d_lock); |
907 |
+@@ -109,7 +109,7 @@ start: |
908 |
+ return NULL; |
909 |
+ } |
910 |
+ |
911 |
+- q = list_entry(next, struct dentry, d_u.d_child); |
912 |
++ q = list_entry(next, struct dentry, d_child); |
913 |
+ |
914 |
+ spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED); |
915 |
+ /* Negative dentry - try next */ |
916 |
+@@ -165,13 +165,13 @@ again: |
917 |
+ goto relock; |
918 |
+ } |
919 |
+ spin_unlock(&p->d_lock); |
920 |
+- next = p->d_u.d_child.next; |
921 |
++ next = p->d_child.next; |
922 |
+ p = parent; |
923 |
+ if (next != &parent->d_subdirs) |
924 |
+ break; |
925 |
+ } |
926 |
+ } |
927 |
+- ret = list_entry(next, struct dentry, d_u.d_child); |
928 |
++ ret = list_entry(next, struct dentry, d_child); |
929 |
+ |
930 |
+ spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED); |
931 |
+ /* Negative dentry - try next */ |
932 |
+@@ -455,7 +455,7 @@ found: |
933 |
+ spin_lock(&sbi->lookup_lock); |
934 |
+ spin_lock(&expired->d_parent->d_lock); |
935 |
+ spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED); |
936 |
+- list_move(&expired->d_parent->d_subdirs, &expired->d_u.d_child); |
937 |
++ list_move(&expired->d_parent->d_subdirs, &expired->d_child); |
938 |
+ spin_unlock(&expired->d_lock); |
939 |
+ spin_unlock(&expired->d_parent->d_lock); |
940 |
+ spin_unlock(&sbi->lookup_lock); |
941 |
+diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c |
942 |
+index 790fa63..2e936c6 100644 |
943 |
+--- a/fs/autofs4/root.c |
944 |
++++ b/fs/autofs4/root.c |
945 |
+@@ -651,7 +651,7 @@ static void autofs_clear_leaf_automount_flags(struct dentry *dentry) |
946 |
+ /* only consider parents below dentrys in the root */ |
947 |
+ if (IS_ROOT(parent->d_parent)) |
948 |
+ return; |
949 |
+- d_child = &dentry->d_u.d_child; |
950 |
++ d_child = &dentry->d_child; |
951 |
+ /* Set parent managed if it's becoming empty */ |
952 |
+ if (d_child->next == &parent->d_subdirs && |
953 |
+ d_child->prev == &parent->d_subdirs) |
954 |
+diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c |
955 |
+index 9895400..7903e62 100644 |
956 |
+--- a/fs/ceph/dir.c |
957 |
++++ b/fs/ceph/dir.c |
958 |
+@@ -104,7 +104,7 @@ static unsigned fpos_off(loff_t p) |
959 |
+ /* |
960 |
+ * When possible, we try to satisfy a readdir by peeking at the |
961 |
+ * dcache. We make this work by carefully ordering dentries on |
962 |
+- * d_u.d_child when we initially get results back from the MDS, and |
963 |
++ * d_child when we initially get results back from the MDS, and |
964 |
+ * falling back to a "normal" sync readdir if any dentries in the dir |
965 |
+ * are dropped. |
966 |
+ * |
967 |
+@@ -140,11 +140,11 @@ static int __dcache_readdir(struct file *filp, |
968 |
+ p = parent->d_subdirs.prev; |
969 |
+ dout(" initial p %p/%p\n", p->prev, p->next); |
970 |
+ } else { |
971 |
+- p = last->d_u.d_child.prev; |
972 |
++ p = last->d_child.prev; |
973 |
+ } |
974 |
+ |
975 |
+ more: |
976 |
+- dentry = list_entry(p, struct dentry, d_u.d_child); |
977 |
++ dentry = list_entry(p, struct dentry, d_child); |
978 |
+ di = ceph_dentry(dentry); |
979 |
+ while (1) { |
980 |
+ dout(" p %p/%p %s d_subdirs %p/%p\n", p->prev, p->next, |
981 |
+@@ -166,7 +166,7 @@ more: |
982 |
+ !dentry->d_inode ? " null" : ""); |
983 |
+ spin_unlock(&dentry->d_lock); |
984 |
+ p = p->prev; |
985 |
+- dentry = list_entry(p, struct dentry, d_u.d_child); |
986 |
++ dentry = list_entry(p, struct dentry, d_child); |
987 |
+ di = ceph_dentry(dentry); |
988 |
+ } |
989 |
+ |
990 |
+diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c |
991 |
+index 87fb132..8e889b7 100644 |
992 |
+--- a/fs/ceph/inode.c |
993 |
++++ b/fs/ceph/inode.c |
994 |
+@@ -868,9 +868,9 @@ static void ceph_set_dentry_offset(struct dentry *dn) |
995 |
+ |
996 |
+ spin_lock(&dir->d_lock); |
997 |
+ spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED); |
998 |
+- list_move(&dn->d_u.d_child, &dir->d_subdirs); |
999 |
++ list_move(&dn->d_child, &dir->d_subdirs); |
1000 |
+ dout("set_dentry_offset %p %lld (%p %p)\n", dn, di->offset, |
1001 |
+- dn->d_u.d_child.prev, dn->d_u.d_child.next); |
1002 |
++ dn->d_child.prev, dn->d_child.next); |
1003 |
+ spin_unlock(&dn->d_lock); |
1004 |
+ spin_unlock(&dir->d_lock); |
1005 |
+ } |
1006 |
+@@ -1256,7 +1256,7 @@ retry_lookup: |
1007 |
+ /* reorder parent's d_subdirs */ |
1008 |
+ spin_lock(&parent->d_lock); |
1009 |
+ spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED); |
1010 |
+- list_move(&dn->d_u.d_child, &parent->d_subdirs); |
1011 |
++ list_move(&dn->d_child, &parent->d_subdirs); |
1012 |
+ spin_unlock(&dn->d_lock); |
1013 |
+ spin_unlock(&parent->d_lock); |
1014 |
+ } |
1015 |
+diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c |
1016 |
+index c0c51e1..710dd05 100644 |
1017 |
+--- a/fs/cifs/inode.c |
1018 |
++++ b/fs/cifs/inode.c |
1019 |
+@@ -823,7 +823,7 @@ inode_has_hashed_dentries(struct inode *inode) |
1020 |
+ struct dentry *dentry; |
1021 |
+ |
1022 |
+ spin_lock(&inode->i_lock); |
1023 |
+- list_for_each_entry(dentry, &inode->i_dentry, d_alias) { |
1024 |
++ list_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { |
1025 |
+ if (!d_unhashed(dentry) || IS_ROOT(dentry)) { |
1026 |
+ spin_unlock(&inode->i_lock); |
1027 |
+ return true; |
1028 |
+diff --git a/fs/coda/cache.c b/fs/coda/cache.c |
1029 |
+index 6901578..4b2e5cb 100644 |
1030 |
+--- a/fs/coda/cache.c |
1031 |
++++ b/fs/coda/cache.c |
1032 |
+@@ -95,7 +95,7 @@ static void coda_flag_children(struct dentry *parent, int flag) |
1033 |
+ spin_lock(&parent->d_lock); |
1034 |
+ list_for_each(child, &parent->d_subdirs) |
1035 |
+ { |
1036 |
+- de = list_entry(child, struct dentry, d_u.d_child); |
1037 |
++ de = list_entry(child, struct dentry, d_child); |
1038 |
+ /* don't know what to do with negative dentries */ |
1039 |
+ if ( ! de->d_inode ) |
1040 |
+ continue; |
1041 |
+diff --git a/fs/dcache.c b/fs/dcache.c |
1042 |
+index d322929..3f65742 100644 |
1043 |
+--- a/fs/dcache.c |
1044 |
++++ b/fs/dcache.c |
1045 |
+@@ -42,7 +42,7 @@ |
1046 |
+ /* |
1047 |
+ * Usage: |
1048 |
+ * dcache->d_inode->i_lock protects: |
1049 |
+- * - i_dentry, d_alias, d_inode of aliases |
1050 |
++ * - i_dentry, d_u.d_alias, d_inode of aliases |
1051 |
+ * dcache_hash_bucket lock protects: |
1052 |
+ * - the dcache hash table |
1053 |
+ * s_anon bl list spinlock protects: |
1054 |
+@@ -57,7 +57,7 @@ |
1055 |
+ * - d_unhashed() |
1056 |
+ * - d_parent and d_subdirs |
1057 |
+ * - childrens' d_child and d_parent |
1058 |
+- * - d_alias, d_inode |
1059 |
++ * - d_u.d_alias, d_inode |
1060 |
+ * |
1061 |
+ * Ordering: |
1062 |
+ * dentry->d_inode->i_lock |
1063 |
+@@ -140,7 +140,6 @@ static void __d_free(struct rcu_head *head) |
1064 |
+ { |
1065 |
+ struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu); |
1066 |
+ |
1067 |
+- WARN_ON(!list_empty(&dentry->d_alias)); |
1068 |
+ if (dname_external(dentry)) |
1069 |
+ kfree(dentry->d_name.name); |
1070 |
+ kmem_cache_free(dentry_cache, dentry); |
1071 |
+@@ -151,6 +150,7 @@ static void __d_free(struct rcu_head *head) |
1072 |
+ */ |
1073 |
+ static void d_free(struct dentry *dentry) |
1074 |
+ { |
1075 |
++ WARN_ON(!list_empty(&dentry->d_u.d_alias)); |
1076 |
+ BUG_ON(dentry->d_count); |
1077 |
+ this_cpu_dec(nr_dentry); |
1078 |
+ if (dentry->d_op && dentry->d_op->d_release) |
1079 |
+@@ -189,7 +189,7 @@ static void dentry_iput(struct dentry * dentry) |
1080 |
+ struct inode *inode = dentry->d_inode; |
1081 |
+ if (inode) { |
1082 |
+ dentry->d_inode = NULL; |
1083 |
+- list_del_init(&dentry->d_alias); |
1084 |
++ list_del_init(&dentry->d_u.d_alias); |
1085 |
+ spin_unlock(&dentry->d_lock); |
1086 |
+ spin_unlock(&inode->i_lock); |
1087 |
+ if (!inode->i_nlink) |
1088 |
+@@ -213,7 +213,7 @@ static void dentry_unlink_inode(struct dentry * dentry) |
1089 |
+ { |
1090 |
+ struct inode *inode = dentry->d_inode; |
1091 |
+ dentry->d_inode = NULL; |
1092 |
+- list_del_init(&dentry->d_alias); |
1093 |
++ list_del_init(&dentry->d_u.d_alias); |
1094 |
+ dentry_rcuwalk_barrier(dentry); |
1095 |
+ spin_unlock(&dentry->d_lock); |
1096 |
+ spin_unlock(&inode->i_lock); |
1097 |
+@@ -306,9 +306,9 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent) |
1098 |
+ __releases(parent->d_lock) |
1099 |
+ __releases(dentry->d_inode->i_lock) |
1100 |
+ { |
1101 |
+- list_del(&dentry->d_u.d_child); |
1102 |
++ __list_del_entry(&dentry->d_child); |
1103 |
+ /* |
1104 |
+- * Inform try_to_ascend() that we are no longer attached to the |
1105 |
++ * Inform ascending readers that we are no longer attached to the |
1106 |
+ * dentry tree |
1107 |
+ */ |
1108 |
+ dentry->d_flags |= DCACHE_DENTRY_KILLED; |
1109 |
+@@ -624,7 +624,7 @@ static struct dentry *__d_find_alias(struct inode *inode, int want_discon) |
1110 |
+ |
1111 |
+ again: |
1112 |
+ discon_alias = NULL; |
1113 |
+- list_for_each_entry(alias, &inode->i_dentry, d_alias) { |
1114 |
++ list_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { |
1115 |
+ spin_lock(&alias->d_lock); |
1116 |
+ if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) { |
1117 |
+ if (IS_ROOT(alias) && |
1118 |
+@@ -677,7 +677,7 @@ void d_prune_aliases(struct inode *inode) |
1119 |
+ struct dentry *dentry; |
1120 |
+ restart: |
1121 |
+ spin_lock(&inode->i_lock); |
1122 |
+- list_for_each_entry(dentry, &inode->i_dentry, d_alias) { |
1123 |
++ list_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { |
1124 |
+ spin_lock(&dentry->d_lock); |
1125 |
+ if (!dentry->d_count) { |
1126 |
+ __dget_dlock(dentry); |
1127 |
+@@ -857,7 +857,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) |
1128 |
+ /* descend to the first leaf in the current subtree */ |
1129 |
+ while (!list_empty(&dentry->d_subdirs)) |
1130 |
+ dentry = list_entry(dentry->d_subdirs.next, |
1131 |
+- struct dentry, d_u.d_child); |
1132 |
++ struct dentry, d_child); |
1133 |
+ |
1134 |
+ /* consume the dentries from this leaf up through its parents |
1135 |
+ * until we find one with children or run out altogether */ |
1136 |
+@@ -889,17 +889,17 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) |
1137 |
+ |
1138 |
+ if (IS_ROOT(dentry)) { |
1139 |
+ parent = NULL; |
1140 |
+- list_del(&dentry->d_u.d_child); |
1141 |
++ list_del(&dentry->d_child); |
1142 |
+ } else { |
1143 |
+ parent = dentry->d_parent; |
1144 |
+ parent->d_count--; |
1145 |
+- list_del(&dentry->d_u.d_child); |
1146 |
++ list_del(&dentry->d_child); |
1147 |
+ } |
1148 |
+ |
1149 |
+ inode = dentry->d_inode; |
1150 |
+ if (inode) { |
1151 |
+ dentry->d_inode = NULL; |
1152 |
+- list_del_init(&dentry->d_alias); |
1153 |
++ list_del_init(&dentry->d_u.d_alias); |
1154 |
+ if (dentry->d_op && dentry->d_op->d_iput) |
1155 |
+ dentry->d_op->d_iput(dentry, inode); |
1156 |
+ else |
1157 |
+@@ -917,7 +917,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) |
1158 |
+ } while (list_empty(&dentry->d_subdirs)); |
1159 |
+ |
1160 |
+ dentry = list_entry(dentry->d_subdirs.next, |
1161 |
+- struct dentry, d_u.d_child); |
1162 |
++ struct dentry, d_child); |
1163 |
+ } |
1164 |
+ } |
1165 |
+ |
1166 |
+@@ -949,34 +949,6 @@ void shrink_dcache_for_umount(struct super_block *sb) |
1167 |
+ } |
1168 |
+ } |
1169 |
+ |
1170 |
+-/* |
1171 |
+- * This tries to ascend one level of parenthood, but |
1172 |
+- * we can race with renaming, so we need to re-check |
1173 |
+- * the parenthood after dropping the lock and check |
1174 |
+- * that the sequence number still matches. |
1175 |
+- */ |
1176 |
+-static struct dentry *try_to_ascend(struct dentry *old, int locked, unsigned seq) |
1177 |
+-{ |
1178 |
+- struct dentry *new = old->d_parent; |
1179 |
+- |
1180 |
+- rcu_read_lock(); |
1181 |
+- spin_unlock(&old->d_lock); |
1182 |
+- spin_lock(&new->d_lock); |
1183 |
+- |
1184 |
+- /* |
1185 |
+- * might go back up the wrong parent if we have had a rename |
1186 |
+- * or deletion |
1187 |
+- */ |
1188 |
+- if (new != old->d_parent || |
1189 |
+- (old->d_flags & DCACHE_DENTRY_KILLED) || |
1190 |
+- (!locked && read_seqretry(&rename_lock, seq))) { |
1191 |
+- spin_unlock(&new->d_lock); |
1192 |
+- new = NULL; |
1193 |
+- } |
1194 |
+- rcu_read_unlock(); |
1195 |
+- return new; |
1196 |
+-} |
1197 |
+- |
1198 |
+ |
1199 |
+ /* |
1200 |
+ * Search for at least 1 mount point in the dentry's subdirs. |
1201 |
+@@ -1010,7 +982,7 @@ repeat: |
1202 |
+ resume: |
1203 |
+ while (next != &this_parent->d_subdirs) { |
1204 |
+ struct list_head *tmp = next; |
1205 |
+- struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child); |
1206 |
++ struct dentry *dentry = list_entry(tmp, struct dentry, d_child); |
1207 |
+ next = tmp->next; |
1208 |
+ |
1209 |
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); |
1210 |
+@@ -1032,17 +1004,32 @@ resume: |
1211 |
+ /* |
1212 |
+ * All done at this level ... ascend and resume the search. |
1213 |
+ */ |
1214 |
++ rcu_read_lock(); |
1215 |
++ascend: |
1216 |
+ if (this_parent != parent) { |
1217 |
+ struct dentry *child = this_parent; |
1218 |
+- this_parent = try_to_ascend(this_parent, locked, seq); |
1219 |
+- if (!this_parent) |
1220 |
++ this_parent = child->d_parent; |
1221 |
++ |
1222 |
++ spin_unlock(&child->d_lock); |
1223 |
++ spin_lock(&this_parent->d_lock); |
1224 |
++ |
1225 |
++ /* might go back up the wrong parent if we have had a rename */ |
1226 |
++ if (!locked && read_seqretry(&rename_lock, seq)) |
1227 |
+ goto rename_retry; |
1228 |
+- next = child->d_u.d_child.next; |
1229 |
++ next = child->d_child.next; |
1230 |
++ while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) { |
1231 |
++ if (next == &this_parent->d_subdirs) |
1232 |
++ goto ascend; |
1233 |
++ child = list_entry(next, struct dentry, d_child); |
1234 |
++ next = next->next; |
1235 |
++ } |
1236 |
++ rcu_read_unlock(); |
1237 |
+ goto resume; |
1238 |
+ } |
1239 |
+- spin_unlock(&this_parent->d_lock); |
1240 |
+ if (!locked && read_seqretry(&rename_lock, seq)) |
1241 |
+ goto rename_retry; |
1242 |
++ spin_unlock(&this_parent->d_lock); |
1243 |
++ rcu_read_unlock(); |
1244 |
+ if (locked) |
1245 |
+ write_sequnlock(&rename_lock); |
1246 |
+ return 0; /* No mount points found in tree */ |
1247 |
+@@ -1054,6 +1041,8 @@ positive: |
1248 |
+ return 1; |
1249 |
+ |
1250 |
+ rename_retry: |
1251 |
++ spin_unlock(&this_parent->d_lock); |
1252 |
++ rcu_read_unlock(); |
1253 |
+ if (locked) |
1254 |
+ goto again; |
1255 |
+ locked = 1; |
1256 |
+@@ -1093,7 +1082,7 @@ repeat: |
1257 |
+ resume: |
1258 |
+ while (next != &this_parent->d_subdirs) { |
1259 |
+ struct list_head *tmp = next; |
1260 |
+- struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child); |
1261 |
++ struct dentry *dentry = list_entry(tmp, struct dentry, d_child); |
1262 |
+ next = tmp->next; |
1263 |
+ |
1264 |
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); |
1265 |
+@@ -1139,23 +1128,40 @@ resume: |
1266 |
+ /* |
1267 |
+ * All done at this level ... ascend and resume the search. |
1268 |
+ */ |
1269 |
++ rcu_read_lock(); |
1270 |
++ascend: |
1271 |
+ if (this_parent != parent) { |
1272 |
+ struct dentry *child = this_parent; |
1273 |
+- this_parent = try_to_ascend(this_parent, locked, seq); |
1274 |
+- if (!this_parent) |
1275 |
++ this_parent = child->d_parent; |
1276 |
++ |
1277 |
++ spin_unlock(&child->d_lock); |
1278 |
++ spin_lock(&this_parent->d_lock); |
1279 |
++ |
1280 |
++ /* might go back up the wrong parent if we have had a rename */ |
1281 |
++ if (!locked && read_seqretry(&rename_lock, seq)) |
1282 |
+ goto rename_retry; |
1283 |
+- next = child->d_u.d_child.next; |
1284 |
++ next = child->d_child.next; |
1285 |
++ while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) { |
1286 |
++ if (next == &this_parent->d_subdirs) |
1287 |
++ goto ascend; |
1288 |
++ child = list_entry(next, struct dentry, d_child); |
1289 |
++ next = next->next; |
1290 |
++ } |
1291 |
++ rcu_read_unlock(); |
1292 |
+ goto resume; |
1293 |
+ } |
1294 |
+ out: |
1295 |
+- spin_unlock(&this_parent->d_lock); |
1296 |
+ if (!locked && read_seqretry(&rename_lock, seq)) |
1297 |
+ goto rename_retry; |
1298 |
++ spin_unlock(&this_parent->d_lock); |
1299 |
++ rcu_read_unlock(); |
1300 |
+ if (locked) |
1301 |
+ write_sequnlock(&rename_lock); |
1302 |
+ return found; |
1303 |
+ |
1304 |
+ rename_retry: |
1305 |
++ spin_unlock(&this_parent->d_lock); |
1306 |
++ rcu_read_unlock(); |
1307 |
+ if (found) |
1308 |
+ return found; |
1309 |
+ if (locked) |
1310 |
+@@ -1230,8 +1236,8 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name) |
1311 |
+ INIT_HLIST_BL_NODE(&dentry->d_hash); |
1312 |
+ INIT_LIST_HEAD(&dentry->d_lru); |
1313 |
+ INIT_LIST_HEAD(&dentry->d_subdirs); |
1314 |
+- INIT_LIST_HEAD(&dentry->d_alias); |
1315 |
+- INIT_LIST_HEAD(&dentry->d_u.d_child); |
1316 |
++ INIT_LIST_HEAD(&dentry->d_u.d_alias); |
1317 |
++ INIT_LIST_HEAD(&dentry->d_child); |
1318 |
+ d_set_d_op(dentry, dentry->d_sb->s_d_op); |
1319 |
+ |
1320 |
+ this_cpu_inc(nr_dentry); |
1321 |
+@@ -1261,7 +1267,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name) |
1322 |
+ */ |
1323 |
+ __dget_dlock(parent); |
1324 |
+ dentry->d_parent = parent; |
1325 |
+- list_add(&dentry->d_u.d_child, &parent->d_subdirs); |
1326 |
++ list_add(&dentry->d_child, &parent->d_subdirs); |
1327 |
+ spin_unlock(&parent->d_lock); |
1328 |
+ |
1329 |
+ return dentry; |
1330 |
+@@ -1318,7 +1324,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode) |
1331 |
+ if (inode) { |
1332 |
+ if (unlikely(IS_AUTOMOUNT(inode))) |
1333 |
+ dentry->d_flags |= DCACHE_NEED_AUTOMOUNT; |
1334 |
+- list_add(&dentry->d_alias, &inode->i_dentry); |
1335 |
++ list_add(&dentry->d_u.d_alias, &inode->i_dentry); |
1336 |
+ } |
1337 |
+ dentry->d_inode = inode; |
1338 |
+ dentry_rcuwalk_barrier(dentry); |
1339 |
+@@ -1343,7 +1349,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode) |
1340 |
+ |
1341 |
+ void d_instantiate(struct dentry *entry, struct inode * inode) |
1342 |
+ { |
1343 |
+- BUG_ON(!list_empty(&entry->d_alias)); |
1344 |
++ BUG_ON(!list_empty(&entry->d_u.d_alias)); |
1345 |
+ if (inode) |
1346 |
+ spin_lock(&inode->i_lock); |
1347 |
+ __d_instantiate(entry, inode); |
1348 |
+@@ -1382,7 +1388,7 @@ static struct dentry *__d_instantiate_unique(struct dentry *entry, |
1349 |
+ return NULL; |
1350 |
+ } |
1351 |
+ |
1352 |
+- list_for_each_entry(alias, &inode->i_dentry, d_alias) { |
1353 |
++ list_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { |
1354 |
+ struct qstr *qstr = &alias->d_name; |
1355 |
+ |
1356 |
+ /* |
1357 |
+@@ -1408,7 +1414,7 @@ struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode) |
1358 |
+ { |
1359 |
+ struct dentry *result; |
1360 |
+ |
1361 |
+- BUG_ON(!list_empty(&entry->d_alias)); |
1362 |
++ BUG_ON(!list_empty(&entry->d_u.d_alias)); |
1363 |
+ |
1364 |
+ if (inode) |
1365 |
+ spin_lock(&inode->i_lock); |
1366 |
+@@ -1458,7 +1464,7 @@ static struct dentry * __d_find_any_alias(struct inode *inode) |
1367 |
+ |
1368 |
+ if (list_empty(&inode->i_dentry)) |
1369 |
+ return NULL; |
1370 |
+- alias = list_first_entry(&inode->i_dentry, struct dentry, d_alias); |
1371 |
++ alias = list_first_entry(&inode->i_dentry, struct dentry, d_u.d_alias); |
1372 |
+ __dget(alias); |
1373 |
+ return alias; |
1374 |
+ } |
1375 |
+@@ -1525,7 +1531,7 @@ struct dentry *d_obtain_alias(struct inode *inode) |
1376 |
+ spin_lock(&tmp->d_lock); |
1377 |
+ tmp->d_inode = inode; |
1378 |
+ tmp->d_flags |= DCACHE_DISCONNECTED; |
1379 |
+- list_add(&tmp->d_alias, &inode->i_dentry); |
1380 |
++ list_add(&tmp->d_u.d_alias, &inode->i_dentry); |
1381 |
+ hlist_bl_lock(&tmp->d_sb->s_anon); |
1382 |
+ hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon); |
1383 |
+ hlist_bl_unlock(&tmp->d_sb->s_anon); |
1384 |
+@@ -1931,7 +1937,7 @@ int d_validate(struct dentry *dentry, struct dentry *dparent) |
1385 |
+ struct dentry *child; |
1386 |
+ |
1387 |
+ spin_lock(&dparent->d_lock); |
1388 |
+- list_for_each_entry(child, &dparent->d_subdirs, d_u.d_child) { |
1389 |
++ list_for_each_entry(child, &dparent->d_subdirs, d_child) { |
1390 |
+ if (dentry == child) { |
1391 |
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); |
1392 |
+ __dget_dlock(dentry); |
1393 |
+@@ -2178,8 +2184,8 @@ static void __d_move(struct dentry * dentry, struct dentry * target) |
1394 |
+ /* Unhash the target: dput() will then get rid of it */ |
1395 |
+ __d_drop(target); |
1396 |
+ |
1397 |
+- list_del(&dentry->d_u.d_child); |
1398 |
+- list_del(&target->d_u.d_child); |
1399 |
++ list_del(&dentry->d_child); |
1400 |
++ list_del(&target->d_child); |
1401 |
+ |
1402 |
+ /* Switch the names.. */ |
1403 |
+ switch_names(dentry, target); |
1404 |
+@@ -2189,15 +2195,15 @@ static void __d_move(struct dentry * dentry, struct dentry * target) |
1405 |
+ if (IS_ROOT(dentry)) { |
1406 |
+ dentry->d_parent = target->d_parent; |
1407 |
+ target->d_parent = target; |
1408 |
+- INIT_LIST_HEAD(&target->d_u.d_child); |
1409 |
++ INIT_LIST_HEAD(&target->d_child); |
1410 |
+ } else { |
1411 |
+ swap(dentry->d_parent, target->d_parent); |
1412 |
+ |
1413 |
+ /* And add them back to the (new) parent lists */ |
1414 |
+- list_add(&target->d_u.d_child, &target->d_parent->d_subdirs); |
1415 |
++ list_add(&target->d_child, &target->d_parent->d_subdirs); |
1416 |
+ } |
1417 |
+ |
1418 |
+- list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs); |
1419 |
++ list_add(&dentry->d_child, &dentry->d_parent->d_subdirs); |
1420 |
+ |
1421 |
+ write_seqcount_end(&target->d_seq); |
1422 |
+ write_seqcount_end(&dentry->d_seq); |
1423 |
+@@ -2304,18 +2310,18 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) |
1424 |
+ swap(dentry->d_name.hash, anon->d_name.hash); |
1425 |
+ |
1426 |
+ dentry->d_parent = (aparent == anon) ? dentry : aparent; |
1427 |
+- list_del(&dentry->d_u.d_child); |
1428 |
++ list_del(&dentry->d_child); |
1429 |
+ if (!IS_ROOT(dentry)) |
1430 |
+- list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs); |
1431 |
++ list_add(&dentry->d_child, &dentry->d_parent->d_subdirs); |
1432 |
+ else |
1433 |
+- INIT_LIST_HEAD(&dentry->d_u.d_child); |
1434 |
++ INIT_LIST_HEAD(&dentry->d_child); |
1435 |
+ |
1436 |
+ anon->d_parent = (dparent == dentry) ? anon : dparent; |
1437 |
+- list_del(&anon->d_u.d_child); |
1438 |
++ list_del(&anon->d_child); |
1439 |
+ if (!IS_ROOT(anon)) |
1440 |
+- list_add(&anon->d_u.d_child, &anon->d_parent->d_subdirs); |
1441 |
++ list_add(&anon->d_child, &anon->d_parent->d_subdirs); |
1442 |
+ else |
1443 |
+- INIT_LIST_HEAD(&anon->d_u.d_child); |
1444 |
++ INIT_LIST_HEAD(&anon->d_child); |
1445 |
+ |
1446 |
+ write_seqcount_end(&dentry->d_seq); |
1447 |
+ write_seqcount_end(&anon->d_seq); |
1448 |
+@@ -2893,7 +2899,7 @@ repeat: |
1449 |
+ resume: |
1450 |
+ while (next != &this_parent->d_subdirs) { |
1451 |
+ struct list_head *tmp = next; |
1452 |
+- struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child); |
1453 |
++ struct dentry *dentry = list_entry(tmp, struct dentry, d_child); |
1454 |
+ next = tmp->next; |
1455 |
+ |
1456 |
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); |
1457 |
+@@ -2914,26 +2920,43 @@ resume: |
1458 |
+ } |
1459 |
+ spin_unlock(&dentry->d_lock); |
1460 |
+ } |
1461 |
++ rcu_read_lock(); |
1462 |
++ascend: |
1463 |
+ if (this_parent != root) { |
1464 |
+ struct dentry *child = this_parent; |
1465 |
+ if (!(this_parent->d_flags & DCACHE_GENOCIDE)) { |
1466 |
+ this_parent->d_flags |= DCACHE_GENOCIDE; |
1467 |
+ this_parent->d_count--; |
1468 |
+ } |
1469 |
+- this_parent = try_to_ascend(this_parent, locked, seq); |
1470 |
+- if (!this_parent) |
1471 |
++ this_parent = child->d_parent; |
1472 |
++ |
1473 |
++ spin_unlock(&child->d_lock); |
1474 |
++ spin_lock(&this_parent->d_lock); |
1475 |
++ |
1476 |
++ /* might go back up the wrong parent if we have had a rename */ |
1477 |
++ if (!locked && read_seqretry(&rename_lock, seq)) |
1478 |
+ goto rename_retry; |
1479 |
+- next = child->d_u.d_child.next; |
1480 |
++ next = child->d_child.next; |
1481 |
++ while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) { |
1482 |
++ if (next == &this_parent->d_subdirs) |
1483 |
++ goto ascend; |
1484 |
++ child = list_entry(next, struct dentry, d_child); |
1485 |
++ next = next->next; |
1486 |
++ } |
1487 |
++ rcu_read_unlock(); |
1488 |
+ goto resume; |
1489 |
+ } |
1490 |
+- spin_unlock(&this_parent->d_lock); |
1491 |
+ if (!locked && read_seqretry(&rename_lock, seq)) |
1492 |
+ goto rename_retry; |
1493 |
++ spin_unlock(&this_parent->d_lock); |
1494 |
++ rcu_read_unlock(); |
1495 |
+ if (locked) |
1496 |
+ write_sequnlock(&rename_lock); |
1497 |
+ return; |
1498 |
+ |
1499 |
+ rename_retry: |
1500 |
++ spin_unlock(&this_parent->d_lock); |
1501 |
++ rcu_read_unlock(); |
1502 |
+ if (locked) |
1503 |
+ goto again; |
1504 |
+ locked = 1; |
1505 |
+diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c |
1506 |
+index 01951c6b..6ac0893 100644 |
1507 |
+--- a/fs/debugfs/inode.c |
1508 |
++++ b/fs/debugfs/inode.c |
1509 |
+@@ -399,7 +399,7 @@ void debugfs_remove_recursive(struct dentry *dentry) |
1510 |
+ * use the d_u.d_child as the rcu head and corrupt this list. |
1511 |
+ */ |
1512 |
+ spin_lock(&parent->d_lock); |
1513 |
+- list_for_each_entry(child, &parent->d_subdirs, d_u.d_child) { |
1514 |
++ list_for_each_entry(child, &parent->d_subdirs, d_child) { |
1515 |
+ if (!debugfs_positive(child)) |
1516 |
+ continue; |
1517 |
+ |
1518 |
+diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c |
1519 |
+index b05acb7..3bbf5e7 100644 |
1520 |
+--- a/fs/exportfs/expfs.c |
1521 |
++++ b/fs/exportfs/expfs.c |
1522 |
+@@ -50,7 +50,7 @@ find_acceptable_alias(struct dentry *result, |
1523 |
+ |
1524 |
+ inode = result->d_inode; |
1525 |
+ spin_lock(&inode->i_lock); |
1526 |
+- list_for_each_entry(dentry, &inode->i_dentry, d_alias) { |
1527 |
++ list_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { |
1528 |
+ dget(dentry); |
1529 |
+ spin_unlock(&inode->i_lock); |
1530 |
+ if (toput) |
1531 |
+diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c |
1532 |
+index a8d03a4..019c29c 100644 |
1533 |
+--- a/fs/ext4/fsync.c |
1534 |
++++ b/fs/ext4/fsync.c |
1535 |
+@@ -139,7 +139,7 @@ static int ext4_sync_parent(struct inode *inode) |
1536 |
+ spin_lock(&inode->i_lock); |
1537 |
+ if (!list_empty(&inode->i_dentry)) { |
1538 |
+ dentry = list_first_entry(&inode->i_dentry, |
1539 |
+- struct dentry, d_alias); |
1540 |
++ struct dentry, d_u.d_alias); |
1541 |
+ dget(dentry); |
1542 |
+ } |
1543 |
+ spin_unlock(&inode->i_lock); |
1544 |
+diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c |
1545 |
+index cd39fa7..c9f2e3d 100644 |
1546 |
+--- a/fs/ext4/namei.c |
1547 |
++++ b/fs/ext4/namei.c |
1548 |
+@@ -1986,7 +1986,7 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode) |
1549 |
+ struct ext4_iloc iloc; |
1550 |
+ int err = 0, rc; |
1551 |
+ |
1552 |
+- if (!ext4_handle_valid(handle) || is_bad_inode(inode)) |
1553 |
++ if (!EXT4_SB(sb)->s_journal || is_bad_inode(inode)) |
1554 |
+ return 0; |
1555 |
+ |
1556 |
+ mutex_lock(&EXT4_SB(sb)->s_orphan_lock); |
1557 |
+@@ -2060,8 +2060,7 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode) |
1558 |
+ struct ext4_iloc iloc; |
1559 |
+ int err = 0; |
1560 |
+ |
1561 |
+- /* ext4_handle_valid() assumes a valid handle_t pointer */ |
1562 |
+- if (handle && !ext4_handle_valid(handle) && |
1563 |
++ if (!EXT4_SB(inode->i_sb)->s_journal && |
1564 |
+ !(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ORPHAN_FS)) |
1565 |
+ return 0; |
1566 |
+ |
1567 |
+@@ -2081,7 +2080,7 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode) |
1568 |
+ * transaction handle with which to update the orphan list on |
1569 |
+ * disk, but we still need to remove the inode from the linked |
1570 |
+ * list in memory. */ |
1571 |
+- if (sbi->s_journal && !handle) |
1572 |
++ if (!handle) |
1573 |
+ goto out; |
1574 |
+ |
1575 |
+ err = ext4_reserve_inode_write(handle, inode, &iloc); |
1576 |
+diff --git a/fs/libfs.c b/fs/libfs.c |
1577 |
+index f6d411e..ce85edf 100644 |
1578 |
+--- a/fs/libfs.c |
1579 |
++++ b/fs/libfs.c |
1580 |
+@@ -104,18 +104,18 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int origin) |
1581 |
+ |
1582 |
+ spin_lock(&dentry->d_lock); |
1583 |
+ /* d_lock not required for cursor */ |
1584 |
+- list_del(&cursor->d_u.d_child); |
1585 |
++ list_del(&cursor->d_child); |
1586 |
+ p = dentry->d_subdirs.next; |
1587 |
+ while (n && p != &dentry->d_subdirs) { |
1588 |
+ struct dentry *next; |
1589 |
+- next = list_entry(p, struct dentry, d_u.d_child); |
1590 |
++ next = list_entry(p, struct dentry, d_child); |
1591 |
+ spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED); |
1592 |
+ if (simple_positive(next)) |
1593 |
+ n--; |
1594 |
+ spin_unlock(&next->d_lock); |
1595 |
+ p = p->next; |
1596 |
+ } |
1597 |
+- list_add_tail(&cursor->d_u.d_child, p); |
1598 |
++ list_add_tail(&cursor->d_child, p); |
1599 |
+ spin_unlock(&dentry->d_lock); |
1600 |
+ } |
1601 |
+ } |
1602 |
+@@ -139,7 +139,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir) |
1603 |
+ { |
1604 |
+ struct dentry *dentry = filp->f_path.dentry; |
1605 |
+ struct dentry *cursor = filp->private_data; |
1606 |
+- struct list_head *p, *q = &cursor->d_u.d_child; |
1607 |
++ struct list_head *p, *q = &cursor->d_child; |
1608 |
+ ino_t ino; |
1609 |
+ int i = filp->f_pos; |
1610 |
+ |
1611 |
+@@ -165,7 +165,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir) |
1612 |
+ |
1613 |
+ for (p=q->next; p != &dentry->d_subdirs; p=p->next) { |
1614 |
+ struct dentry *next; |
1615 |
+- next = list_entry(p, struct dentry, d_u.d_child); |
1616 |
++ next = list_entry(p, struct dentry, d_child); |
1617 |
+ spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED); |
1618 |
+ if (!simple_positive(next)) { |
1619 |
+ spin_unlock(&next->d_lock); |
1620 |
+@@ -282,7 +282,7 @@ int simple_empty(struct dentry *dentry) |
1621 |
+ int ret = 0; |
1622 |
+ |
1623 |
+ spin_lock(&dentry->d_lock); |
1624 |
+- list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) { |
1625 |
++ list_for_each_entry(child, &dentry->d_subdirs, d_child) { |
1626 |
+ spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED); |
1627 |
+ if (simple_positive(child)) { |
1628 |
+ spin_unlock(&child->d_lock); |
1629 |
+diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c |
1630 |
+index 844bd64..efa38a9 100644 |
1631 |
+--- a/fs/ncpfs/dir.c |
1632 |
++++ b/fs/ncpfs/dir.c |
1633 |
+@@ -391,7 +391,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos) |
1634 |
+ spin_lock(&parent->d_lock); |
1635 |
+ next = parent->d_subdirs.next; |
1636 |
+ while (next != &parent->d_subdirs) { |
1637 |
+- dent = list_entry(next, struct dentry, d_u.d_child); |
1638 |
++ dent = list_entry(next, struct dentry, d_child); |
1639 |
+ if ((unsigned long)dent->d_fsdata == fpos) { |
1640 |
+ if (dent->d_inode) |
1641 |
+ dget(dent); |
1642 |
+diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h |
1643 |
+index 09881e6..64a817a 100644 |
1644 |
+--- a/fs/ncpfs/ncplib_kernel.h |
1645 |
++++ b/fs/ncpfs/ncplib_kernel.h |
1646 |
+@@ -194,7 +194,7 @@ ncp_renew_dentries(struct dentry *parent) |
1647 |
+ spin_lock(&parent->d_lock); |
1648 |
+ next = parent->d_subdirs.next; |
1649 |
+ while (next != &parent->d_subdirs) { |
1650 |
+- dentry = list_entry(next, struct dentry, d_u.d_child); |
1651 |
++ dentry = list_entry(next, struct dentry, d_child); |
1652 |
+ |
1653 |
+ if (dentry->d_fsdata == NULL) |
1654 |
+ ncp_age_dentry(server, dentry); |
1655 |
+@@ -216,7 +216,7 @@ ncp_invalidate_dircache_entries(struct dentry *parent) |
1656 |
+ spin_lock(&parent->d_lock); |
1657 |
+ next = parent->d_subdirs.next; |
1658 |
+ while (next != &parent->d_subdirs) { |
1659 |
+- dentry = list_entry(next, struct dentry, d_u.d_child); |
1660 |
++ dentry = list_entry(next, struct dentry, d_child); |
1661 |
+ dentry->d_fsdata = NULL; |
1662 |
+ ncp_age_dentry(server, dentry); |
1663 |
+ next = next->next; |
1664 |
+diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c |
1665 |
+index dcb6154..d7abf9e 100644 |
1666 |
+--- a/fs/nfs/getroot.c |
1667 |
++++ b/fs/nfs/getroot.c |
1668 |
+@@ -65,7 +65,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i |
1669 |
+ */ |
1670 |
+ spin_lock(&sb->s_root->d_inode->i_lock); |
1671 |
+ spin_lock(&sb->s_root->d_lock); |
1672 |
+- list_del_init(&sb->s_root->d_alias); |
1673 |
++ list_del_init(&sb->s_root->d_u.d_alias); |
1674 |
+ spin_unlock(&sb->s_root->d_lock); |
1675 |
+ spin_unlock(&sb->s_root->d_inode->i_lock); |
1676 |
+ } |
1677 |
+diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c |
1678 |
+index 79b47cb..f8ea28f 100644 |
1679 |
+--- a/fs/notify/fsnotify.c |
1680 |
++++ b/fs/notify/fsnotify.c |
1681 |
+@@ -62,14 +62,14 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode) |
1682 |
+ spin_lock(&inode->i_lock); |
1683 |
+ /* run all of the dentries associated with this inode. Since this is a |
1684 |
+ * directory, there damn well better only be one item on this list */ |
1685 |
+- list_for_each_entry(alias, &inode->i_dentry, d_alias) { |
1686 |
++ list_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { |
1687 |
+ struct dentry *child; |
1688 |
+ |
1689 |
+ /* run all of the children of the original inode and fix their |
1690 |
+ * d_flags to indicate parental interest (their parent is the |
1691 |
+ * original inode) */ |
1692 |
+ spin_lock(&alias->d_lock); |
1693 |
+- list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) { |
1694 |
++ list_for_each_entry(child, &alias->d_subdirs, d_child) { |
1695 |
+ if (!child->d_inode) |
1696 |
+ continue; |
1697 |
+ |
1698 |
+diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c |
1699 |
+index e5ba348..26977cc 100644 |
1700 |
+--- a/fs/ocfs2/dcache.c |
1701 |
++++ b/fs/ocfs2/dcache.c |
1702 |
+@@ -175,7 +175,7 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode, |
1703 |
+ |
1704 |
+ spin_lock(&inode->i_lock); |
1705 |
+ list_for_each(p, &inode->i_dentry) { |
1706 |
+- dentry = list_entry(p, struct dentry, d_alias); |
1707 |
++ dentry = list_entry(p, struct dentry, d_u.d_alias); |
1708 |
+ |
1709 |
+ spin_lock(&dentry->d_lock); |
1710 |
+ if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) { |
1711 |
+diff --git a/fs/udf/inode.c b/fs/udf/inode.c |
1712 |
+index af37ce3..a0f6ded 100644 |
1713 |
+--- a/fs/udf/inode.c |
1714 |
++++ b/fs/udf/inode.c |
1715 |
+@@ -1176,13 +1176,22 @@ update_time: |
1716 |
+ return 0; |
1717 |
+ } |
1718 |
+ |
1719 |
++/* |
1720 |
++ * Maximum length of linked list formed by ICB hierarchy. The chosen number is |
1721 |
++ * arbitrary - just that we hopefully don't limit any real use of rewritten |
1722 |
++ * inode on write-once media but avoid looping for too long on corrupted media. |
1723 |
++ */ |
1724 |
++#define UDF_MAX_ICB_NESTING 1024 |
1725 |
++ |
1726 |
+ static void __udf_read_inode(struct inode *inode) |
1727 |
+ { |
1728 |
+ struct buffer_head *bh = NULL; |
1729 |
+ struct fileEntry *fe; |
1730 |
+ uint16_t ident; |
1731 |
+ struct udf_inode_info *iinfo = UDF_I(inode); |
1732 |
++ unsigned int indirections = 0; |
1733 |
+ |
1734 |
++reread: |
1735 |
+ /* |
1736 |
+ * Set defaults, but the inode is still incomplete! |
1737 |
+ * Note: get_new_inode() sets the following on a new inode: |
1738 |
+@@ -1219,28 +1228,26 @@ static void __udf_read_inode(struct inode *inode) |
1739 |
+ ibh = udf_read_ptagged(inode->i_sb, &iinfo->i_location, 1, |
1740 |
+ &ident); |
1741 |
+ if (ident == TAG_IDENT_IE && ibh) { |
1742 |
+- struct buffer_head *nbh = NULL; |
1743 |
+ struct kernel_lb_addr loc; |
1744 |
+ struct indirectEntry *ie; |
1745 |
+ |
1746 |
+ ie = (struct indirectEntry *)ibh->b_data; |
1747 |
+ loc = lelb_to_cpu(ie->indirectICB.extLocation); |
1748 |
+ |
1749 |
+- if (ie->indirectICB.extLength && |
1750 |
+- (nbh = udf_read_ptagged(inode->i_sb, &loc, 0, |
1751 |
+- &ident))) { |
1752 |
+- if (ident == TAG_IDENT_FE || |
1753 |
+- ident == TAG_IDENT_EFE) { |
1754 |
+- memcpy(&iinfo->i_location, |
1755 |
+- &loc, |
1756 |
+- sizeof(struct kernel_lb_addr)); |
1757 |
+- brelse(bh); |
1758 |
+- brelse(ibh); |
1759 |
+- brelse(nbh); |
1760 |
+- __udf_read_inode(inode); |
1761 |
++ if (ie->indirectICB.extLength) { |
1762 |
++ brelse(bh); |
1763 |
++ brelse(ibh); |
1764 |
++ memcpy(&iinfo->i_location, &loc, |
1765 |
++ sizeof(struct kernel_lb_addr)); |
1766 |
++ if (++indirections > UDF_MAX_ICB_NESTING) { |
1767 |
++ udf_err(inode->i_sb, |
1768 |
++ "too many ICBs in ICB hierarchy" |
1769 |
++ " (max %d supported)\n", |
1770 |
++ UDF_MAX_ICB_NESTING); |
1771 |
++ make_bad_inode(inode); |
1772 |
+ return; |
1773 |
+ } |
1774 |
+- brelse(nbh); |
1775 |
++ goto reread; |
1776 |
+ } |
1777 |
+ } |
1778 |
+ brelse(ibh); |
1779 |
+diff --git a/include/linux/dcache.h b/include/linux/dcache.h |
1780 |
+index 1dfe974..99374de 100644 |
1781 |
+--- a/include/linux/dcache.h |
1782 |
++++ b/include/linux/dcache.h |
1783 |
+@@ -133,15 +133,15 @@ struct dentry { |
1784 |
+ void *d_fsdata; /* fs-specific data */ |
1785 |
+ |
1786 |
+ struct list_head d_lru; /* LRU list */ |
1787 |
++ struct list_head d_child; /* child of parent list */ |
1788 |
++ struct list_head d_subdirs; /* our children */ |
1789 |
+ /* |
1790 |
+- * d_child and d_rcu can share memory |
1791 |
++ * d_alias and d_rcu can share memory |
1792 |
+ */ |
1793 |
+ union { |
1794 |
+- struct list_head d_child; /* child of parent list */ |
1795 |
++ struct list_head d_alias; /* inode alias list */ |
1796 |
+ struct rcu_head d_rcu; |
1797 |
+ } d_u; |
1798 |
+- struct list_head d_subdirs; /* our children */ |
1799 |
+- struct list_head d_alias; /* inode alias list */ |
1800 |
+ }; |
1801 |
+ |
1802 |
+ /* |
1803 |
+diff --git a/include/net/ipv6.h b/include/net/ipv6.h |
1804 |
+index 00a2eb6..ab2e6d7 100644 |
1805 |
+--- a/include/net/ipv6.h |
1806 |
++++ b/include/net/ipv6.h |
1807 |
+@@ -481,6 +481,7 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add |
1808 |
+ } |
1809 |
+ |
1810 |
+ extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); |
1811 |
++void ipv6_proxy_select_ident(struct sk_buff *skb); |
1812 |
+ |
1813 |
+ /* |
1814 |
+ * Prototypes exported by ipv6 |
1815 |
+diff --git a/include/net/tcp.h b/include/net/tcp.h |
1816 |
+index 238255b..e90235f 100644 |
1817 |
+--- a/include/net/tcp.h |
1818 |
++++ b/include/net/tcp.h |
1819 |
+@@ -1214,11 +1214,13 @@ extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr); |
1820 |
+ #define tcp_twsk_md5_key(twsk) NULL |
1821 |
+ #endif |
1822 |
+ |
1823 |
+-extern struct tcp_md5sig_pool __percpu *tcp_alloc_md5sig_pool(struct sock *); |
1824 |
+-extern void tcp_free_md5sig_pool(void); |
1825 |
++extern bool tcp_alloc_md5sig_pool(void); |
1826 |
+ |
1827 |
+ extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); |
1828 |
+-extern void tcp_put_md5sig_pool(void); |
1829 |
++static inline void tcp_put_md5sig_pool(void) |
1830 |
++{ |
1831 |
++ local_bh_enable(); |
1832 |
++} |
1833 |
+ |
1834 |
+ extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *); |
1835 |
+ extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *, |
1836 |
+diff --git a/kernel/cgroup.c b/kernel/cgroup.c |
1837 |
+index ffcf896..eafb6dd 100644 |
1838 |
+--- a/kernel/cgroup.c |
1839 |
++++ b/kernel/cgroup.c |
1840 |
+@@ -881,7 +881,7 @@ static void cgroup_clear_directory(struct dentry *dentry) |
1841 |
+ spin_lock(&dentry->d_lock); |
1842 |
+ node = dentry->d_subdirs.next; |
1843 |
+ while (node != &dentry->d_subdirs) { |
1844 |
+- struct dentry *d = list_entry(node, struct dentry, d_u.d_child); |
1845 |
++ struct dentry *d = list_entry(node, struct dentry, d_child); |
1846 |
+ |
1847 |
+ spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED); |
1848 |
+ list_del_init(node); |
1849 |
+@@ -915,7 +915,7 @@ static void cgroup_d_remove_dir(struct dentry *dentry) |
1850 |
+ parent = dentry->d_parent; |
1851 |
+ spin_lock(&parent->d_lock); |
1852 |
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); |
1853 |
+- list_del_init(&dentry->d_u.d_child); |
1854 |
++ list_del_init(&dentry->d_child); |
1855 |
+ spin_unlock(&dentry->d_lock); |
1856 |
+ spin_unlock(&parent->d_lock); |
1857 |
+ remove_dir(dentry); |
1858 |
+diff --git a/mm/memory.c b/mm/memory.c |
1859 |
+index 5a7f314..628cadc 100644 |
1860 |
+--- a/mm/memory.c |
1861 |
++++ b/mm/memory.c |
1862 |
+@@ -870,20 +870,20 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, |
1863 |
+ if (!pte_file(pte)) { |
1864 |
+ swp_entry_t entry = pte_to_swp_entry(pte); |
1865 |
+ |
1866 |
+- if (swap_duplicate(entry) < 0) |
1867 |
+- return entry.val; |
1868 |
+- |
1869 |
+- /* make sure dst_mm is on swapoff's mmlist. */ |
1870 |
+- if (unlikely(list_empty(&dst_mm->mmlist))) { |
1871 |
+- spin_lock(&mmlist_lock); |
1872 |
+- if (list_empty(&dst_mm->mmlist)) |
1873 |
+- list_add(&dst_mm->mmlist, |
1874 |
+- &src_mm->mmlist); |
1875 |
+- spin_unlock(&mmlist_lock); |
1876 |
+- } |
1877 |
+- if (likely(!non_swap_entry(entry))) |
1878 |
++ if (likely(!non_swap_entry(entry))) { |
1879 |
++ if (swap_duplicate(entry) < 0) |
1880 |
++ return entry.val; |
1881 |
++ |
1882 |
++ /* make sure dst_mm is on swapoff's mmlist. */ |
1883 |
++ if (unlikely(list_empty(&dst_mm->mmlist))) { |
1884 |
++ spin_lock(&mmlist_lock); |
1885 |
++ if (list_empty(&dst_mm->mmlist)) |
1886 |
++ list_add(&dst_mm->mmlist, |
1887 |
++ &src_mm->mmlist); |
1888 |
++ spin_unlock(&mmlist_lock); |
1889 |
++ } |
1890 |
+ rss[MM_SWAPENTS]++; |
1891 |
+- else if (is_write_migration_entry(entry) && |
1892 |
++ } else if (is_write_migration_entry(entry) && |
1893 |
+ is_cow_mapping(vm_flags)) { |
1894 |
+ /* |
1895 |
+ * COW mappings require pages in both parent |
1896 |
+diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c |
1897 |
+index 76da979..1cdb4a9 100644 |
1898 |
+--- a/net/ipv4/fib_semantics.c |
1899 |
++++ b/net/ipv4/fib_semantics.c |
1900 |
+@@ -467,7 +467,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi) |
1901 |
+ return 1; |
1902 |
+ |
1903 |
+ attrlen = rtnh_attrlen(rtnh); |
1904 |
+- if (attrlen < 0) { |
1905 |
++ if (attrlen > 0) { |
1906 |
+ struct nlattr *nla, *attrs = rtnh_attrs(rtnh); |
1907 |
+ |
1908 |
+ nla = nla_find(attrs, attrlen, RTA_GATEWAY); |
1909 |
+diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c |
1910 |
+index 115157b..bf2e54b 100644 |
1911 |
+--- a/net/ipv4/ip_output.c |
1912 |
++++ b/net/ipv4/ip_output.c |
1913 |
+@@ -1472,6 +1472,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, |
1914 |
+ struct ipcm_cookie ipc; |
1915 |
+ struct flowi4 fl4; |
1916 |
+ struct rtable *rt = skb_rtable(skb); |
1917 |
++ int err; |
1918 |
+ |
1919 |
+ if (ip_options_echo(&replyopts.opt.opt, skb)) |
1920 |
+ return; |
1921 |
+@@ -1509,8 +1510,13 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, |
1922 |
+ sk->sk_priority = skb->priority; |
1923 |
+ sk->sk_protocol = ip_hdr(skb)->protocol; |
1924 |
+ sk->sk_bound_dev_if = arg->bound_dev_if; |
1925 |
+- ip_append_data(sk, &fl4, ip_reply_glue_bits, arg->iov->iov_base, len, 0, |
1926 |
+- &ipc, &rt, MSG_DONTWAIT); |
1927 |
++ err = ip_append_data(sk, &fl4, ip_reply_glue_bits, arg->iov->iov_base, |
1928 |
++ len, 0, &ipc, &rt, MSG_DONTWAIT); |
1929 |
++ if (unlikely(err)) { |
1930 |
++ ip_flush_pending_frames(sk); |
1931 |
++ goto out; |
1932 |
++ } |
1933 |
++ |
1934 |
+ if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) { |
1935 |
+ if (arg->csumoffset >= 0) |
1936 |
+ *((__sum16 *)skb_transport_header(skb) + |
1937 |
+@@ -1519,7 +1525,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, |
1938 |
+ skb->ip_summed = CHECKSUM_NONE; |
1939 |
+ ip_push_pending_frames(sk, &fl4); |
1940 |
+ } |
1941 |
+- |
1942 |
++out: |
1943 |
+ bh_unlock_sock(sk); |
1944 |
+ |
1945 |
+ ip_rt_put(rt); |
1946 |
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
1947 |
+index ec8b4b7e..32c9e83 100644 |
1948 |
+--- a/net/ipv4/tcp.c |
1949 |
++++ b/net/ipv4/tcp.c |
1950 |
+@@ -2863,104 +2863,42 @@ int tcp_gro_complete(struct sk_buff *skb) |
1951 |
+ EXPORT_SYMBOL(tcp_gro_complete); |
1952 |
+ |
1953 |
+ #ifdef CONFIG_TCP_MD5SIG |
1954 |
+-static unsigned long tcp_md5sig_users; |
1955 |
+-static struct tcp_md5sig_pool __percpu *tcp_md5sig_pool; |
1956 |
+-static DEFINE_SPINLOCK(tcp_md5sig_pool_lock); |
1957 |
++static DEFINE_PER_CPU(struct tcp_md5sig_pool, tcp_md5sig_pool); |
1958 |
++static DEFINE_MUTEX(tcp_md5sig_mutex); |
1959 |
++static bool tcp_md5sig_pool_populated = false; |
1960 |
+ |
1961 |
+-static void __tcp_free_md5sig_pool(struct tcp_md5sig_pool __percpu *pool) |
1962 |
++static void __tcp_alloc_md5sig_pool(void) |
1963 |
+ { |
1964 |
+ int cpu; |
1965 |
+ |
1966 |
+ for_each_possible_cpu(cpu) { |
1967 |
+- struct tcp_md5sig_pool *p = per_cpu_ptr(pool, cpu); |
1968 |
++ if (!per_cpu(tcp_md5sig_pool, cpu).md5_desc.tfm) { |
1969 |
++ struct crypto_hash *hash; |
1970 |
+ |
1971 |
+- if (p->md5_desc.tfm) |
1972 |
+- crypto_free_hash(p->md5_desc.tfm); |
1973 |
+- } |
1974 |
+- free_percpu(pool); |
1975 |
+-} |
1976 |
+- |
1977 |
+-void tcp_free_md5sig_pool(void) |
1978 |
+-{ |
1979 |
+- struct tcp_md5sig_pool __percpu *pool = NULL; |
1980 |
+- |
1981 |
+- spin_lock_bh(&tcp_md5sig_pool_lock); |
1982 |
+- if (--tcp_md5sig_users == 0) { |
1983 |
+- pool = tcp_md5sig_pool; |
1984 |
+- tcp_md5sig_pool = NULL; |
1985 |
++ hash = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC); |
1986 |
++ if (IS_ERR_OR_NULL(hash)) |
1987 |
++ return; |
1988 |
++ per_cpu(tcp_md5sig_pool, cpu).md5_desc.tfm = hash; |
1989 |
++ } |
1990 |
+ } |
1991 |
+- spin_unlock_bh(&tcp_md5sig_pool_lock); |
1992 |
+- if (pool) |
1993 |
+- __tcp_free_md5sig_pool(pool); |
1994 |
++ /* before setting tcp_md5sig_pool_populated, we must commit all writes |
1995 |
++ * to memory. See smp_rmb() in tcp_get_md5sig_pool() |
1996 |
++ */ |
1997 |
++ smp_wmb(); |
1998 |
++ tcp_md5sig_pool_populated = true; |
1999 |
+ } |
2000 |
+-EXPORT_SYMBOL(tcp_free_md5sig_pool); |
2001 |
+ |
2002 |
+-static struct tcp_md5sig_pool __percpu * |
2003 |
+-__tcp_alloc_md5sig_pool(struct sock *sk) |
2004 |
++bool tcp_alloc_md5sig_pool(void) |
2005 |
+ { |
2006 |
+- int cpu; |
2007 |
+- struct tcp_md5sig_pool __percpu *pool; |
2008 |
+- |
2009 |
+- pool = alloc_percpu(struct tcp_md5sig_pool); |
2010 |
+- if (!pool) |
2011 |
+- return NULL; |
2012 |
+- |
2013 |
+- for_each_possible_cpu(cpu) { |
2014 |
+- struct crypto_hash *hash; |
2015 |
++ if (unlikely(!tcp_md5sig_pool_populated)) { |
2016 |
++ mutex_lock(&tcp_md5sig_mutex); |
2017 |
+ |
2018 |
+- hash = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC); |
2019 |
+- if (!hash || IS_ERR(hash)) |
2020 |
+- goto out_free; |
2021 |
++ if (!tcp_md5sig_pool_populated) |
2022 |
++ __tcp_alloc_md5sig_pool(); |
2023 |
+ |
2024 |
+- per_cpu_ptr(pool, cpu)->md5_desc.tfm = hash; |
2025 |
++ mutex_unlock(&tcp_md5sig_mutex); |
2026 |
+ } |
2027 |
+- return pool; |
2028 |
+-out_free: |
2029 |
+- __tcp_free_md5sig_pool(pool); |
2030 |
+- return NULL; |
2031 |
+-} |
2032 |
+- |
2033 |
+-struct tcp_md5sig_pool __percpu *tcp_alloc_md5sig_pool(struct sock *sk) |
2034 |
+-{ |
2035 |
+- struct tcp_md5sig_pool __percpu *pool; |
2036 |
+- int alloc = 0; |
2037 |
+- |
2038 |
+-retry: |
2039 |
+- spin_lock_bh(&tcp_md5sig_pool_lock); |
2040 |
+- pool = tcp_md5sig_pool; |
2041 |
+- if (tcp_md5sig_users++ == 0) { |
2042 |
+- alloc = 1; |
2043 |
+- spin_unlock_bh(&tcp_md5sig_pool_lock); |
2044 |
+- } else if (!pool) { |
2045 |
+- tcp_md5sig_users--; |
2046 |
+- spin_unlock_bh(&tcp_md5sig_pool_lock); |
2047 |
+- cpu_relax(); |
2048 |
+- goto retry; |
2049 |
+- } else |
2050 |
+- spin_unlock_bh(&tcp_md5sig_pool_lock); |
2051 |
+- |
2052 |
+- if (alloc) { |
2053 |
+- /* we cannot hold spinlock here because this may sleep. */ |
2054 |
+- struct tcp_md5sig_pool __percpu *p; |
2055 |
+- |
2056 |
+- p = __tcp_alloc_md5sig_pool(sk); |
2057 |
+- spin_lock_bh(&tcp_md5sig_pool_lock); |
2058 |
+- if (!p) { |
2059 |
+- tcp_md5sig_users--; |
2060 |
+- spin_unlock_bh(&tcp_md5sig_pool_lock); |
2061 |
+- return NULL; |
2062 |
+- } |
2063 |
+- pool = tcp_md5sig_pool; |
2064 |
+- if (pool) { |
2065 |
+- /* oops, it has already been assigned. */ |
2066 |
+- spin_unlock_bh(&tcp_md5sig_pool_lock); |
2067 |
+- __tcp_free_md5sig_pool(p); |
2068 |
+- } else { |
2069 |
+- tcp_md5sig_pool = pool = p; |
2070 |
+- spin_unlock_bh(&tcp_md5sig_pool_lock); |
2071 |
+- } |
2072 |
+- } |
2073 |
+- return pool; |
2074 |
++ return tcp_md5sig_pool_populated; |
2075 |
+ } |
2076 |
+ EXPORT_SYMBOL(tcp_alloc_md5sig_pool); |
2077 |
+ |
2078 |
+@@ -2974,31 +2912,18 @@ EXPORT_SYMBOL(tcp_alloc_md5sig_pool); |
2079 |
+ */ |
2080 |
+ struct tcp_md5sig_pool *tcp_get_md5sig_pool(void) |
2081 |
+ { |
2082 |
+- struct tcp_md5sig_pool __percpu *p; |
2083 |
+- |
2084 |
+ local_bh_disable(); |
2085 |
+ |
2086 |
+- spin_lock(&tcp_md5sig_pool_lock); |
2087 |
+- p = tcp_md5sig_pool; |
2088 |
+- if (p) |
2089 |
+- tcp_md5sig_users++; |
2090 |
+- spin_unlock(&tcp_md5sig_pool_lock); |
2091 |
+- |
2092 |
+- if (p) |
2093 |
+- return this_cpu_ptr(p); |
2094 |
+- |
2095 |
++ if (tcp_md5sig_pool_populated) { |
2096 |
++ /* coupled with smp_wmb() in __tcp_alloc_md5sig_pool() */ |
2097 |
++ smp_rmb(); |
2098 |
++ return this_cpu_ptr(&tcp_md5sig_pool); |
2099 |
++ } |
2100 |
+ local_bh_enable(); |
2101 |
+ return NULL; |
2102 |
+ } |
2103 |
+ EXPORT_SYMBOL(tcp_get_md5sig_pool); |
2104 |
+ |
2105 |
+-void tcp_put_md5sig_pool(void) |
2106 |
+-{ |
2107 |
+- local_bh_enable(); |
2108 |
+- tcp_free_md5sig_pool(); |
2109 |
+-} |
2110 |
+-EXPORT_SYMBOL(tcp_put_md5sig_pool); |
2111 |
+- |
2112 |
+ int tcp_md5_hash_header(struct tcp_md5sig_pool *hp, |
2113 |
+ const struct tcphdr *th) |
2114 |
+ { |
2115 |
+diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c |
2116 |
+index 26eb8e2..b4e0eb4 100644 |
2117 |
+--- a/net/ipv4/tcp_ipv4.c |
2118 |
++++ b/net/ipv4/tcp_ipv4.c |
2119 |
+@@ -938,8 +938,7 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, |
2120 |
+ } |
2121 |
+ |
2122 |
+ md5sig = tp->md5sig_info; |
2123 |
+- if (md5sig->entries4 == 0 && |
2124 |
+- tcp_alloc_md5sig_pool(sk) == NULL) { |
2125 |
++ if (md5sig->entries4 == 0 && !tcp_alloc_md5sig_pool()) { |
2126 |
+ kfree(newkey); |
2127 |
+ return -ENOMEM; |
2128 |
+ } |
2129 |
+@@ -949,8 +948,6 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, |
2130 |
+ (md5sig->entries4 + 1)), GFP_ATOMIC); |
2131 |
+ if (!keys) { |
2132 |
+ kfree(newkey); |
2133 |
+- if (md5sig->entries4 == 0) |
2134 |
+- tcp_free_md5sig_pool(); |
2135 |
+ return -ENOMEM; |
2136 |
+ } |
2137 |
+ |
2138 |
+@@ -994,7 +991,6 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr) |
2139 |
+ kfree(tp->md5sig_info->keys4); |
2140 |
+ tp->md5sig_info->keys4 = NULL; |
2141 |
+ tp->md5sig_info->alloced4 = 0; |
2142 |
+- tcp_free_md5sig_pool(); |
2143 |
+ } else if (tp->md5sig_info->entries4 != i) { |
2144 |
+ /* Need to do some manipulation */ |
2145 |
+ memmove(&tp->md5sig_info->keys4[i], |
2146 |
+@@ -1022,7 +1018,6 @@ static void tcp_v4_clear_md5_list(struct sock *sk) |
2147 |
+ for (i = 0; i < tp->md5sig_info->entries4; i++) |
2148 |
+ kfree(tp->md5sig_info->keys4[i].base.key); |
2149 |
+ tp->md5sig_info->entries4 = 0; |
2150 |
+- tcp_free_md5sig_pool(); |
2151 |
+ } |
2152 |
+ if (tp->md5sig_info->keys4) { |
2153 |
+ kfree(tp->md5sig_info->keys4); |
2154 |
+diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c |
2155 |
+index 66363b6..00e1530 100644 |
2156 |
+--- a/net/ipv4/tcp_minisocks.c |
2157 |
++++ b/net/ipv4/tcp_minisocks.c |
2158 |
+@@ -365,7 +365,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) |
2159 |
+ if (key != NULL) { |
2160 |
+ memcpy(&tcptw->tw_md5_key, key->key, key->keylen); |
2161 |
+ tcptw->tw_md5_keylen = key->keylen; |
2162 |
+- if (tcp_alloc_md5sig_pool(sk) == NULL) |
2163 |
++ if (!tcp_alloc_md5sig_pool()) |
2164 |
+ BUG(); |
2165 |
+ } |
2166 |
+ } while (0); |
2167 |
+@@ -403,11 +403,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) |
2168 |
+ |
2169 |
+ void tcp_twsk_destructor(struct sock *sk) |
2170 |
+ { |
2171 |
+-#ifdef CONFIG_TCP_MD5SIG |
2172 |
+- struct tcp_timewait_sock *twsk = tcp_twsk(sk); |
2173 |
+- if (twsk->tw_md5_keylen) |
2174 |
+- tcp_free_md5sig_pool(); |
2175 |
+-#endif |
2176 |
+ } |
2177 |
+ EXPORT_SYMBOL_GPL(tcp_twsk_destructor); |
2178 |
+ |
2179 |
+diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile |
2180 |
+index 686934a..4b20d56 100644 |
2181 |
+--- a/net/ipv6/Makefile |
2182 |
++++ b/net/ipv6/Makefile |
2183 |
+@@ -37,6 +37,6 @@ obj-$(CONFIG_NETFILTER) += netfilter/ |
2184 |
+ obj-$(CONFIG_IPV6_SIT) += sit.o |
2185 |
+ obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o |
2186 |
+ |
2187 |
+-obj-y += addrconf_core.o exthdrs_core.o |
2188 |
++obj-y += addrconf_core.o exthdrs_core.o output_core.o |
2189 |
+ |
2190 |
+ obj-$(subst m,y,$(CONFIG_IPV6)) += inet6_hashtables.o |
2191 |
+diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c |
2192 |
+new file mode 100644 |
2193 |
+index 0000000..a6126c6 |
2194 |
+--- /dev/null |
2195 |
++++ b/net/ipv6/output_core.c |
2196 |
+@@ -0,0 +1,38 @@ |
2197 |
++#include <linux/export.h> |
2198 |
++#include <linux/skbuff.h> |
2199 |
++#include <net/ip.h> |
2200 |
++#include <net/ipv6.h> |
2201 |
++ |
2202 |
++/* This function exists only for tap drivers that must support broken |
2203 |
++ * clients requesting UFO without specifying an IPv6 fragment ID. |
2204 |
++ * |
2205 |
++ * This is similar to ipv6_select_ident() but we use an independent hash |
2206 |
++ * seed to limit information leakage. |
2207 |
++ */ |
2208 |
++void ipv6_proxy_select_ident(struct sk_buff *skb) |
2209 |
++{ |
2210 |
++ static u32 ip6_proxy_idents_hashrnd __read_mostly; |
2211 |
++ static bool hashrnd_initialized = false; |
2212 |
++ struct in6_addr buf[2]; |
2213 |
++ struct in6_addr *addrs; |
2214 |
++ u32 hash, id; |
2215 |
++ |
2216 |
++ addrs = skb_header_pointer(skb, |
2217 |
++ skb_network_offset(skb) + |
2218 |
++ offsetof(struct ipv6hdr, saddr), |
2219 |
++ sizeof(buf), buf); |
2220 |
++ if (!addrs) |
2221 |
++ return; |
2222 |
++ |
2223 |
++ if (unlikely(!hashrnd_initialized)) { |
2224 |
++ hashrnd_initialized = true; |
2225 |
++ get_random_bytes(&ip6_proxy_idents_hashrnd, |
2226 |
++ sizeof(ip6_proxy_idents_hashrnd)); |
2227 |
++ } |
2228 |
++ hash = __ipv6_addr_jhash(&addrs[1], ip6_proxy_idents_hashrnd); |
2229 |
++ hash = __ipv6_addr_jhash(&addrs[0], hash); |
2230 |
++ |
2231 |
++ id = ip_idents_reserve(hash, 1); |
2232 |
++ skb_shinfo(skb)->ip6_frag_id = htonl(id); |
2233 |
++} |
2234 |
++EXPORT_SYMBOL_GPL(ipv6_proxy_select_ident); |
2235 |
+diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c |
2236 |
+index 057a9d2..655cc60 100644 |
2237 |
+--- a/net/ipv6/tcp_ipv6.c |
2238 |
++++ b/net/ipv6/tcp_ipv6.c |
2239 |
+@@ -592,7 +592,7 @@ static int tcp_v6_md5_do_add(struct sock *sk, const struct in6_addr *peer, |
2240 |
+ sk_nocaps_add(sk, NETIF_F_GSO_MASK); |
2241 |
+ } |
2242 |
+ if (tp->md5sig_info->entries6 == 0 && |
2243 |
+- tcp_alloc_md5sig_pool(sk) == NULL) { |
2244 |
++ !tcp_alloc_md5sig_pool()) { |
2245 |
+ kfree(newkey); |
2246 |
+ return -ENOMEM; |
2247 |
+ } |
2248 |
+@@ -602,8 +602,6 @@ static int tcp_v6_md5_do_add(struct sock *sk, const struct in6_addr *peer, |
2249 |
+ |
2250 |
+ if (!keys) { |
2251 |
+ kfree(newkey); |
2252 |
+- if (tp->md5sig_info->entries6 == 0) |
2253 |
+- tcp_free_md5sig_pool(); |
2254 |
+ return -ENOMEM; |
2255 |
+ } |
2256 |
+ |
2257 |
+@@ -649,7 +647,6 @@ static int tcp_v6_md5_do_del(struct sock *sk, const struct in6_addr *peer) |
2258 |
+ kfree(tp->md5sig_info->keys6); |
2259 |
+ tp->md5sig_info->keys6 = NULL; |
2260 |
+ tp->md5sig_info->alloced6 = 0; |
2261 |
+- tcp_free_md5sig_pool(); |
2262 |
+ } else { |
2263 |
+ /* shrink the database */ |
2264 |
+ if (tp->md5sig_info->entries6 != i) |
2265 |
+@@ -673,7 +670,6 @@ static void tcp_v6_clear_md5_list (struct sock *sk) |
2266 |
+ for (i = 0; i < tp->md5sig_info->entries6; i++) |
2267 |
+ kfree(tp->md5sig_info->keys6[i].base.key); |
2268 |
+ tp->md5sig_info->entries6 = 0; |
2269 |
+- tcp_free_md5sig_pool(); |
2270 |
+ } |
2271 |
+ |
2272 |
+ kfree(tp->md5sig_info->keys6); |
2273 |
+@@ -684,7 +680,6 @@ static void tcp_v6_clear_md5_list (struct sock *sk) |
2274 |
+ for (i = 0; i < tp->md5sig_info->entries4; i++) |
2275 |
+ kfree(tp->md5sig_info->keys4[i].base.key); |
2276 |
+ tp->md5sig_info->entries4 = 0; |
2277 |
+- tcp_free_md5sig_pool(); |
2278 |
+ } |
2279 |
+ |
2280 |
+ kfree(tp->md5sig_info->keys4); |
2281 |
+diff --git a/net/sctp/auth.c b/net/sctp/auth.c |
2282 |
+index 333926d..53d455c 100644 |
2283 |
+--- a/net/sctp/auth.c |
2284 |
++++ b/net/sctp/auth.c |
2285 |
+@@ -866,8 +866,6 @@ int sctp_auth_set_key(struct sctp_endpoint *ep, |
2286 |
+ list_add(&cur_key->key_list, sh_keys); |
2287 |
+ |
2288 |
+ cur_key->key = key; |
2289 |
+- sctp_auth_key_hold(key); |
2290 |
+- |
2291 |
+ return 0; |
2292 |
+ nomem: |
2293 |
+ if (!replace) |
2294 |
+diff --git a/net/sctp/output.c b/net/sctp/output.c |
2295 |
+index 5bd9aa9..c3b8549 100644 |
2296 |
+--- a/net/sctp/output.c |
2297 |
++++ b/net/sctp/output.c |
2298 |
+@@ -384,12 +384,12 @@ int sctp_packet_transmit(struct sctp_packet *packet) |
2299 |
+ sk = chunk->skb->sk; |
2300 |
+ |
2301 |
+ /* Allocate the new skb. */ |
2302 |
+- nskb = alloc_skb(packet->size + LL_MAX_HEADER, GFP_ATOMIC); |
2303 |
++ nskb = alloc_skb(packet->size + MAX_HEADER, GFP_ATOMIC); |
2304 |
+ if (!nskb) |
2305 |
+ goto nomem; |
2306 |
+ |
2307 |
+ /* Make sure the outbound skb has enough header room reserved. */ |
2308 |
+- skb_reserve(nskb, packet->overhead + LL_MAX_HEADER); |
2309 |
++ skb_reserve(nskb, packet->overhead + MAX_HEADER); |
2310 |
+ |
2311 |
+ /* Set the owning socket so that we know where to get the |
2312 |
+ * destination IP address. |
2313 |
+diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c |
2314 |
+index d8d4704..c40952c 100644 |
2315 |
+--- a/net/sctp/sm_make_chunk.c |
2316 |
++++ b/net/sctp/sm_make_chunk.c |
2317 |
+@@ -2570,6 +2570,9 @@ do_addr_param: |
2318 |
+ addr_param = param.v + sizeof(sctp_addip_param_t); |
2319 |
+ |
2320 |
+ af = sctp_get_af_specific(param_type2af(param.p->type)); |
2321 |
++ if (af == NULL) |
2322 |
++ break; |
2323 |
++ |
2324 |
+ af->from_addr_param(&addr, addr_param, |
2325 |
+ htons(asoc->peer.port), 0); |
2326 |
+ |
2327 |
+diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c |
2328 |
+index b4f802d..4dd8dcf 100644 |
2329 |
+--- a/security/selinux/selinuxfs.c |
2330 |
++++ b/security/selinux/selinuxfs.c |
2331 |
+@@ -1197,7 +1197,7 @@ static void sel_remove_entries(struct dentry *de) |
2332 |
+ spin_lock(&de->d_lock); |
2333 |
+ node = de->d_subdirs.next; |
2334 |
+ while (node != &de->d_subdirs) { |
2335 |
+- struct dentry *d = list_entry(node, struct dentry, d_u.d_child); |
2336 |
++ struct dentry *d = list_entry(node, struct dentry, d_child); |
2337 |
+ |
2338 |
+ spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED); |
2339 |
+ list_del_init(node); |
2340 |
+@@ -1704,12 +1704,12 @@ static void sel_remove_classes(void) |
2341 |
+ |
2342 |
+ list_for_each(class_node, &class_dir->d_subdirs) { |
2343 |
+ struct dentry *class_subdir = list_entry(class_node, |
2344 |
+- struct dentry, d_u.d_child); |
2345 |
++ struct dentry, d_child); |
2346 |
+ struct list_head *class_subdir_node; |
2347 |
+ |
2348 |
+ list_for_each(class_subdir_node, &class_subdir->d_subdirs) { |
2349 |
+ struct dentry *d = list_entry(class_subdir_node, |
2350 |
+- struct dentry, d_u.d_child); |
2351 |
++ struct dentry, d_child); |
2352 |
+ |
2353 |
+ if (d->d_inode) |
2354 |
+ if (d->d_inode->i_mode & S_IFDIR) |
2355 |
|
2356 |
diff --git a/3.2.65/4420_grsecurity-3.0-3.2.65-201412280855.patch b/3.2.66/4420_grsecurity-3.0-3.2.65-201412280855.patch |
2357 |
similarity index 100% |
2358 |
rename from 3.2.65/4420_grsecurity-3.0-3.2.65-201412280855.patch |
2359 |
rename to 3.2.66/4420_grsecurity-3.0-3.2.65-201412280855.patch |
2360 |
|
2361 |
diff --git a/3.2.65/4425_grsec_remove_EI_PAX.patch b/3.2.66/4425_grsec_remove_EI_PAX.patch |
2362 |
similarity index 100% |
2363 |
rename from 3.2.65/4425_grsec_remove_EI_PAX.patch |
2364 |
rename to 3.2.66/4425_grsec_remove_EI_PAX.patch |
2365 |
|
2366 |
diff --git a/3.2.65/4427_force_XATTR_PAX_tmpfs.patch b/3.2.66/4427_force_XATTR_PAX_tmpfs.patch |
2367 |
similarity index 100% |
2368 |
rename from 3.2.65/4427_force_XATTR_PAX_tmpfs.patch |
2369 |
rename to 3.2.66/4427_force_XATTR_PAX_tmpfs.patch |
2370 |
|
2371 |
diff --git a/3.2.65/4430_grsec-remove-localversion-grsec.patch b/3.2.66/4430_grsec-remove-localversion-grsec.patch |
2372 |
similarity index 100% |
2373 |
rename from 3.2.65/4430_grsec-remove-localversion-grsec.patch |
2374 |
rename to 3.2.66/4430_grsec-remove-localversion-grsec.patch |
2375 |
|
2376 |
diff --git a/3.2.65/4435_grsec-mute-warnings.patch b/3.2.66/4435_grsec-mute-warnings.patch |
2377 |
similarity index 100% |
2378 |
rename from 3.2.65/4435_grsec-mute-warnings.patch |
2379 |
rename to 3.2.66/4435_grsec-mute-warnings.patch |
2380 |
|
2381 |
diff --git a/3.2.65/4440_grsec-remove-protected-paths.patch b/3.2.66/4440_grsec-remove-protected-paths.patch |
2382 |
similarity index 100% |
2383 |
rename from 3.2.65/4440_grsec-remove-protected-paths.patch |
2384 |
rename to 3.2.66/4440_grsec-remove-protected-paths.patch |
2385 |
|
2386 |
diff --git a/3.2.65/4450_grsec-kconfig-default-gids.patch b/3.2.66/4450_grsec-kconfig-default-gids.patch |
2387 |
similarity index 100% |
2388 |
rename from 3.2.65/4450_grsec-kconfig-default-gids.patch |
2389 |
rename to 3.2.66/4450_grsec-kconfig-default-gids.patch |
2390 |
|
2391 |
diff --git a/3.2.65/4465_selinux-avc_audit-log-curr_ip.patch b/3.2.66/4465_selinux-avc_audit-log-curr_ip.patch |
2392 |
similarity index 100% |
2393 |
rename from 3.2.65/4465_selinux-avc_audit-log-curr_ip.patch |
2394 |
rename to 3.2.66/4465_selinux-avc_audit-log-curr_ip.patch |
2395 |
|
2396 |
diff --git a/3.2.65/4470_disable-compat_vdso.patch b/3.2.66/4470_disable-compat_vdso.patch |
2397 |
similarity index 100% |
2398 |
rename from 3.2.65/4470_disable-compat_vdso.patch |
2399 |
rename to 3.2.66/4470_disable-compat_vdso.patch |
2400 |
|
2401 |
diff --git a/3.2.65/4475_emutramp_default_on.patch b/3.2.66/4475_emutramp_default_on.patch |
2402 |
similarity index 100% |
2403 |
rename from 3.2.65/4475_emutramp_default_on.patch |
2404 |
rename to 3.2.66/4475_emutramp_default_on.patch |