1 |
commit: 230909a311c93618d18dd8cb92ba15bea420bd07 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 18 12:45:44 2012 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 18 12:45:44 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-patchset.git;a=commit;h=230909a3 |
7 |
|
8 |
Grsec/PaX: 2.9-{2.6.32.59,3.2.20,3.4.3}-201206171836 |
9 |
|
10 |
--- |
11 |
2.6.32/0000_README | 2 +- |
12 |
..._grsecurity-2.9.1-2.6.32.59-201206171956.patch} | 418 ++++-- |
13 |
3.2.20/0000_README | 2 +- |
14 |
...420_grsecurity-2.9.1-3.2.20-201206171957.patch} | 283 +++-- |
15 |
{3.4.2 => 3.4.3}/0000_README | 6 +- |
16 |
3.4.3/1002_linux-3.4.3.patch | 1622 ++++++++++++++++++++ |
17 |
.../4420_grsecurity-2.9.1-3.4.3-201206171836.patch | 137 +- |
18 |
.../4430_grsec-remove-localversion-grsec.patch | 0 |
19 |
{3.4.2 => 3.4.3}/4435_grsec-mute-warnings.patch | 0 |
20 |
.../4440_grsec-remove-protected-paths.patch | 0 |
21 |
.../4445_grsec-pax-without-grsec.patch | 0 |
22 |
.../4450_grsec-kconfig-default-gids.patch | 0 |
23 |
{3.4.2 => 3.4.3}/4455_grsec-kconfig-gentoo.patch | 0 |
24 |
.../4460-grsec-kconfig-proc-user.patch | 0 |
25 |
.../4465_selinux-avc_audit-log-curr_ip.patch | 0 |
26 |
{3.4.2 => 3.4.3}/4470_disable-compat_vdso.patch | 0 |
27 |
16 files changed, 2160 insertions(+), 310 deletions(-) |
28 |
|
29 |
diff --git a/2.6.32/0000_README b/2.6.32/0000_README |
30 |
index 75c3519..e239f2b 100644 |
31 |
--- a/2.6.32/0000_README |
32 |
+++ b/2.6.32/0000_README |
33 |
@@ -30,7 +30,7 @@ Patch: 1058_linux-2.6.32.59.patch |
34 |
From: http://www.kernel.org |
35 |
Desc: Linux 2.6.32.59 |
36 |
|
37 |
-Patch: 4420_grsecurity-2.9.1-2.6.32.59-201206160835.patch |
38 |
+Patch: 4420_grsecurity-2.9.1-2.6.32.59-201206171956.patch |
39 |
From: http://www.grsecurity.net |
40 |
Desc: hardened-sources base patch from upstream grsecurity |
41 |
|
42 |
|
43 |
diff --git a/2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201206160835.patch b/2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201206171956.patch |
44 |
similarity index 99% |
45 |
rename from 2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201206160835.patch |
46 |
rename to 2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201206171956.patch |
47 |
index 249ffe4..eff2b70 100644 |
48 |
--- a/2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201206160835.patch |
49 |
+++ b/2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201206171956.patch |
50 |
@@ -221,7 +221,7 @@ index 613da5d..4fe3eda 100644 |
51 |
M: Liam Girdwood <lrg@××××××××××××.uk> |
52 |
M: Mark Brown <broonie@×××××××××××××××××××××××.com> |
53 |
diff --git a/Makefile b/Makefile |
54 |
-index 3a9a721..683dc09 100644 |
55 |
+index 3a9a721..69f34e7 100644 |
56 |
--- a/Makefile |
57 |
+++ b/Makefile |
58 |
@@ -221,8 +221,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
59 |
@@ -256,12 +256,13 @@ index 3a9a721..683dc09 100644 |
60 |
include/linux/version.h headers_% \ |
61 |
kernelrelease kernelversion |
62 |
|
63 |
-@@ -526,6 +527,55 @@ else |
64 |
+@@ -526,6 +527,56 @@ else |
65 |
KBUILD_CFLAGS += -O2 |
66 |
endif |
67 |
|
68 |
+ifndef DISABLE_PAX_PLUGINS |
69 |
-+ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(CC)"), y) |
70 |
++PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(HOSTCXX)" "$(CC)") |
71 |
++ifneq ($(PLUGINCC),) |
72 |
+ifndef DISABLE_PAX_CONSTIFY_PLUGIN |
73 |
+ifndef CONFIG_UML |
74 |
+CONSTIFY_PLUGIN_CFLAGS := -fplugin=$(objtree)/tools/gcc/constify_plugin.so -DCONSTIFY_PLUGIN |
75 |
@@ -291,7 +292,7 @@ index 3a9a721..683dc09 100644 |
76 |
+GCC_PLUGINS_CFLAGS := $(CONSTIFY_PLUGIN_CFLAGS) $(STACKLEAK_PLUGIN_CFLAGS) $(KALLOCSTAT_PLUGIN_CFLAGS) |
77 |
+GCC_PLUGINS_CFLAGS += $(KERNEXEC_PLUGIN_CFLAGS) $(CHECKER_PLUGIN_CFLAGS) $(COLORIZE_PLUGIN_CFLAGS) $(SIZE_OVERFLOW_PLUGIN_CFLAGS) |
78 |
+GCC_PLUGINS_AFLAGS := $(KERNEXEC_PLUGIN_AFLAGS) |
79 |
-+export CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN CHECKER_PLUGIN SIZE_OVERFLOW_PLUGIN |
80 |
++export PLUGINCC CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN CHECKER_PLUGIN SIZE_OVERFLOW_PLUGIN |
81 |
+ifeq ($(KBUILD_EXTMOD),) |
82 |
+gcc-plugins: |
83 |
+ $(Q)$(MAKE) $(build)=tools/gcc |
84 |
@@ -312,7 +313,7 @@ index 3a9a721..683dc09 100644 |
85 |
include $(srctree)/arch/$(SRCARCH)/Makefile |
86 |
|
87 |
ifneq ($(CONFIG_FRAME_WARN),0) |
88 |
-@@ -647,7 +697,7 @@ export mod_strip_cmd |
89 |
+@@ -647,7 +698,7 @@ export mod_strip_cmd |
90 |
|
91 |
|
92 |
ifeq ($(KBUILD_EXTMOD),) |
93 |
@@ -321,7 +322,7 @@ index 3a9a721..683dc09 100644 |
94 |
|
95 |
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ |
96 |
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \ |
97 |
-@@ -868,6 +918,8 @@ vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE |
98 |
+@@ -868,6 +919,8 @@ vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE |
99 |
|
100 |
# The actual objects are generated when descending, |
101 |
# make sure no implicit rule kicks in |
102 |
@@ -330,7 +331,7 @@ index 3a9a721..683dc09 100644 |
103 |
$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; |
104 |
|
105 |
# Handle descending into subdirectories listed in $(vmlinux-dirs) |
106 |
-@@ -877,7 +929,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; |
107 |
+@@ -877,7 +930,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; |
108 |
# Error messages still appears in the original language |
109 |
|
110 |
PHONY += $(vmlinux-dirs) |
111 |
@@ -339,7 +340,7 @@ index 3a9a721..683dc09 100644 |
112 |
$(Q)$(MAKE) $(build)=$@ |
113 |
|
114 |
# Build the kernel release string |
115 |
-@@ -986,6 +1038,7 @@ prepare0: archprepare FORCE |
116 |
+@@ -986,6 +1039,7 @@ prepare0: archprepare FORCE |
117 |
$(Q)$(MAKE) $(build)=. missing-syscalls |
118 |
|
119 |
# All the preparing.. |
120 |
@@ -347,7 +348,7 @@ index 3a9a721..683dc09 100644 |
121 |
prepare: prepare0 |
122 |
|
123 |
# The asm symlink changes when $(ARCH) changes. |
124 |
-@@ -1127,6 +1180,8 @@ all: modules |
125 |
+@@ -1127,6 +1181,8 @@ all: modules |
126 |
# using awk while concatenating to the final file. |
127 |
|
128 |
PHONY += modules |
129 |
@@ -356,7 +357,7 @@ index 3a9a721..683dc09 100644 |
130 |
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) |
131 |
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order |
132 |
@$(kecho) ' Building modules, stage 2.'; |
133 |
-@@ -1136,7 +1191,7 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) |
134 |
+@@ -1136,7 +1192,7 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) |
135 |
|
136 |
# Target to prepare building external modules |
137 |
PHONY += modules_prepare |
138 |
@@ -365,7 +366,7 @@ index 3a9a721..683dc09 100644 |
139 |
|
140 |
# Target to install modules |
141 |
PHONY += modules_install |
142 |
-@@ -1201,7 +1256,7 @@ MRPROPER_FILES += .config .config.old include/asm .version .old_version \ |
143 |
+@@ -1201,7 +1257,7 @@ MRPROPER_FILES += .config .config.old include/asm .version .old_version \ |
144 |
include/linux/autoconf.h include/linux/version.h \ |
145 |
include/linux/utsrelease.h \ |
146 |
include/linux/bounds.h include/asm*/asm-offsets.h \ |
147 |
@@ -374,7 +375,7 @@ index 3a9a721..683dc09 100644 |
148 |
|
149 |
# clean - Delete most, but leave enough to build external modules |
150 |
# |
151 |
-@@ -1245,7 +1300,7 @@ distclean: mrproper |
152 |
+@@ -1245,7 +1301,7 @@ distclean: mrproper |
153 |
@find $(srctree) $(RCS_FIND_IGNORE) \ |
154 |
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \ |
155 |
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ |
156 |
@@ -383,7 +384,7 @@ index 3a9a721..683dc09 100644 |
157 |
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ |
158 |
-type f -print | xargs rm -f |
159 |
|
160 |
-@@ -1292,6 +1347,7 @@ help: |
161 |
+@@ -1292,6 +1348,7 @@ help: |
162 |
@echo ' modules_prepare - Set up for building external modules' |
163 |
@echo ' tags/TAGS - Generate tags file for editors' |
164 |
@echo ' cscope - Generate cscope index' |
165 |
@@ -391,7 +392,7 @@ index 3a9a721..683dc09 100644 |
166 |
@echo ' kernelrelease - Output the release version string' |
167 |
@echo ' kernelversion - Output the version stored in Makefile' |
168 |
@echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ |
169 |
-@@ -1393,6 +1449,8 @@ PHONY += $(module-dirs) modules |
170 |
+@@ -1393,6 +1450,8 @@ PHONY += $(module-dirs) modules |
171 |
$(module-dirs): crmodverdir $(objtree)/Module.symvers |
172 |
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) |
173 |
|
174 |
@@ -400,7 +401,7 @@ index 3a9a721..683dc09 100644 |
175 |
modules: $(module-dirs) |
176 |
@$(kecho) ' Building modules, stage 2.'; |
177 |
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
178 |
-@@ -1448,7 +1506,7 @@ endif # KBUILD_EXTMOD |
179 |
+@@ -1448,7 +1507,7 @@ endif # KBUILD_EXTMOD |
180 |
quiet_cmd_tags = GEN $@ |
181 |
cmd_tags = $(CONFIG_SHELL) $(srctree)/scripts/tags.sh $@ |
182 |
|
183 |
@@ -409,7 +410,7 @@ index 3a9a721..683dc09 100644 |
184 |
$(call cmd,tags) |
185 |
|
186 |
# Scripts to check various things for consistency |
187 |
-@@ -1513,17 +1571,21 @@ else |
188 |
+@@ -1513,17 +1572,21 @@ else |
189 |
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) |
190 |
endif |
191 |
|
192 |
@@ -435,7 +436,7 @@ index 3a9a721..683dc09 100644 |
193 |
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
194 |
%.symtypes: %.c prepare scripts FORCE |
195 |
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
196 |
-@@ -1533,11 +1595,15 @@ endif |
197 |
+@@ -1533,11 +1596,15 @@ endif |
198 |
$(cmd_crmodverdir) |
199 |
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
200 |
$(build)=$(build-dir) |
201 |
@@ -14192,7 +14193,7 @@ index 61c5874..8a046e9 100644 |
202 |
# include "uaccess_32.h" |
203 |
#else |
204 |
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h |
205 |
-index 632fb44..b8785282 100644 |
206 |
+index 632fb44..9aef8c8 100644 |
207 |
--- a/arch/x86/include/asm/uaccess_32.h |
208 |
+++ b/arch/x86/include/asm/uaccess_32.h |
209 |
@@ -12,15 +12,15 @@ |
210 |
@@ -14287,7 +14288,7 @@ index 632fb44..b8785282 100644 |
211 |
if (__builtin_constant_p(n)) { |
212 |
unsigned long ret; |
213 |
|
214 |
-@@ -182,14 +205,62 @@ static __always_inline unsigned long |
215 |
+@@ -182,14 +205,86 @@ static __always_inline unsigned long |
216 |
__copy_from_user_inatomic_nocache(void *to, const void __user *from, |
217 |
unsigned long n) |
218 |
{ |
219 |
@@ -14298,6 +14299,22 @@ index 632fb44..b8785282 100644 |
220 |
+ return __copy_from_user_ll_nocache_nozero(to, from, n); |
221 |
+} |
222 |
+ |
223 |
++extern void copy_to_user_overflow(void) |
224 |
++#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS |
225 |
++ __compiletime_error("copy_to_user() buffer size is not provably correct") |
226 |
++#else |
227 |
++ __compiletime_warning("copy_to_user() buffer size is not provably correct") |
228 |
++#endif |
229 |
++; |
230 |
++ |
231 |
++extern void copy_from_user_overflow(void) |
232 |
++#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS |
233 |
++ __compiletime_error("copy_from_user() buffer size is not provably correct") |
234 |
++#else |
235 |
++ __compiletime_warning("copy_from_user() buffer size is not provably correct") |
236 |
++#endif |
237 |
++; |
238 |
++ |
239 |
+/** |
240 |
+ * copy_to_user: - Copy a block of data into user space. |
241 |
+ * @to: Destination address, in user space. |
242 |
@@ -14314,7 +14331,11 @@ index 632fb44..b8785282 100644 |
243 |
+static __always_inline unsigned long __must_check |
244 |
+copy_to_user(void __user *to, const void *from, unsigned long n) |
245 |
+{ |
246 |
-+ if (access_ok(VERIFY_WRITE, to, n)) |
247 |
++ int sz = __compiletime_object_size(from); |
248 |
++ |
249 |
++ if (unlikely(sz != -1 && sz < n)) |
250 |
++ copy_to_user_overflow(); |
251 |
++ else if (access_ok(VERIFY_WRITE, to, n)) |
252 |
+ n = __copy_to_user(to, from, n); |
253 |
+ return n; |
254 |
+} |
255 |
@@ -14338,7 +14359,11 @@ index 632fb44..b8785282 100644 |
256 |
+static __always_inline unsigned long __must_check |
257 |
+copy_from_user(void *to, const void __user *from, unsigned long n) |
258 |
+{ |
259 |
-+ if (access_ok(VERIFY_READ, from, n)) |
260 |
++ int sz = __compiletime_object_size(to); |
261 |
++ |
262 |
++ if (unlikely(sz != -1 && sz < n)) |
263 |
++ copy_from_user_overflow(); |
264 |
++ else if (access_ok(VERIFY_READ, from, n)) |
265 |
+ n = __copy_from_user(to, from, n); |
266 |
+ else if ((long)n > 0) { |
267 |
+ if (!__builtin_constant_p(n)) |
268 |
@@ -14356,7 +14381,7 @@ index 632fb44..b8785282 100644 |
269 |
long __must_check strncpy_from_user(char *dst, const char __user *src, |
270 |
long count); |
271 |
long __must_check __strncpy_from_user(char *dst, |
272 |
-@@ -212,7 +283,7 @@ long __must_check __strncpy_from_user(char *dst, |
273 |
+@@ -212,7 +307,7 @@ long __must_check __strncpy_from_user(char *dst, |
274 |
#define strlen_user(str) strnlen_user(str, LONG_MAX) |
275 |
|
276 |
long strnlen_user(const char __user *str, long n); |
277 |
@@ -14367,7 +14392,7 @@ index 632fb44..b8785282 100644 |
278 |
|
279 |
#endif /* _ASM_X86_UACCESS_32_H */ |
280 |
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h |
281 |
-index db24b21..00b1ea6 100644 |
282 |
+index db24b21..443d022 100644 |
283 |
--- a/arch/x86/include/asm/uaccess_64.h |
284 |
+++ b/arch/x86/include/asm/uaccess_64.h |
285 |
@@ -9,6 +9,9 @@ |
286 |
@@ -14380,7 +14405,7 @@ index db24b21..00b1ea6 100644 |
287 |
|
288 |
/* |
289 |
* Copy To/From Userspace |
290 |
-@@ -16,116 +19,205 @@ |
291 |
+@@ -16,116 +19,233 @@ |
292 |
|
293 |
/* Handles exceptions in both to and from, but doesn't do access_ok */ |
294 |
__must_check unsigned long |
295 |
@@ -14394,12 +14419,29 @@ index db24b21..00b1ea6 100644 |
296 |
-__must_check unsigned long |
297 |
-copy_in_user(void __user *to, const void __user *from, unsigned len); |
298 |
+copy_in_user(void __user *to, const void __user *from, unsigned long len); |
299 |
++ |
300 |
++extern void copy_to_user_overflow(void) |
301 |
++#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS |
302 |
++ __compiletime_error("copy_to_user() buffer size is not provably correct") |
303 |
++#else |
304 |
++ __compiletime_warning("copy_to_user() buffer size is not provably correct") |
305 |
++#endif |
306 |
++; |
307 |
++ |
308 |
++extern void copy_from_user_overflow(void) |
309 |
++#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS |
310 |
++ __compiletime_error("copy_from_user() buffer size is not provably correct") |
311 |
++#else |
312 |
++ __compiletime_warning("copy_from_user() buffer size is not provably correct") |
313 |
++#endif |
314 |
++; |
315 |
|
316 |
static __always_inline __must_check |
317 |
-int __copy_from_user(void *dst, const void __user *src, unsigned size) |
318 |
+unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long size) |
319 |
{ |
320 |
- int ret = 0; |
321 |
++ int sz = __compiletime_object_size(dst); |
322 |
+ unsigned ret = 0; |
323 |
|
324 |
might_fault(); |
325 |
@@ -14414,6 +14456,11 @@ index db24b21..00b1ea6 100644 |
326 |
+ return size; |
327 |
+#endif |
328 |
+ |
329 |
++ if (unlikely(sz != -1 && sz < size)) { |
330 |
++ copy_from_user_overflow(); |
331 |
++ return size; |
332 |
++ } |
333 |
++ |
334 |
+ if (!__builtin_constant_p(size)) { |
335 |
+ check_object_size(dst, size, false); |
336 |
+ |
337 |
@@ -14480,6 +14527,7 @@ index db24b21..00b1ea6 100644 |
338 |
+unsigned long __copy_to_user(void __user *dst, const void *src, unsigned long size) |
339 |
{ |
340 |
- int ret = 0; |
341 |
++ int sz = __compiletime_object_size(dst); |
342 |
+ unsigned ret = 0; |
343 |
|
344 |
might_fault(); |
345 |
@@ -14496,6 +14544,11 @@ index db24b21..00b1ea6 100644 |
346 |
+ return size; |
347 |
+#endif |
348 |
+ |
349 |
++ if (unlikely(sz != -1 && sz < size)) { |
350 |
++ copy_to_user_overflow(); |
351 |
++ return size; |
352 |
++ } |
353 |
++ |
354 |
+ if (!__builtin_constant_p(size)) { |
355 |
+ check_object_size(src, size, true); |
356 |
+ |
357 |
@@ -14624,7 +14677,7 @@ index db24b21..00b1ea6 100644 |
358 |
ret, "b", "b", "=q", 1); |
359 |
if (likely(!ret)) |
360 |
__put_user_asm(tmp, (u8 __user *)dst, |
361 |
-@@ -134,7 +226,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
362 |
+@@ -134,7 +254,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
363 |
} |
364 |
case 2: { |
365 |
u16 tmp; |
366 |
@@ -14633,7 +14686,7 @@ index db24b21..00b1ea6 100644 |
367 |
ret, "w", "w", "=r", 2); |
368 |
if (likely(!ret)) |
369 |
__put_user_asm(tmp, (u16 __user *)dst, |
370 |
-@@ -144,7 +236,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
371 |
+@@ -144,7 +264,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
372 |
|
373 |
case 4: { |
374 |
u32 tmp; |
375 |
@@ -14642,7 +14695,7 @@ index db24b21..00b1ea6 100644 |
376 |
ret, "l", "k", "=r", 4); |
377 |
if (likely(!ret)) |
378 |
__put_user_asm(tmp, (u32 __user *)dst, |
379 |
-@@ -153,7 +245,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
380 |
+@@ -153,7 +273,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
381 |
} |
382 |
case 8: { |
383 |
u64 tmp; |
384 |
@@ -14651,7 +14704,7 @@ index db24b21..00b1ea6 100644 |
385 |
ret, "q", "", "=r", 8); |
386 |
if (likely(!ret)) |
387 |
__put_user_asm(tmp, (u64 __user *)dst, |
388 |
-@@ -161,8 +253,16 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
389 |
+@@ -161,8 +281,16 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
390 |
return ret; |
391 |
} |
392 |
default: |
393 |
@@ -14670,7 +14723,7 @@ index db24b21..00b1ea6 100644 |
394 |
} |
395 |
} |
396 |
|
397 |
-@@ -173,36 +273,78 @@ __strncpy_from_user(char *dst, const char __user *src, long count); |
398 |
+@@ -173,36 +301,78 @@ __strncpy_from_user(char *dst, const char __user *src, long count); |
399 |
__must_check long strnlen_user(const char __user *str, long n); |
400 |
__must_check long __strnlen_user(const char __user *str, long n); |
401 |
__must_check long strlen_user(const char __user *str); |
402 |
@@ -25034,7 +25087,7 @@ index bf9a7d5..fb06ab5 100644 |
403 |
ret |
404 |
CFI_ENDPROC |
405 |
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c |
406 |
-index 1f118d4..fc661b0 100644 |
407 |
+index 1f118d4..a99a1eb 100644 |
408 |
--- a/arch/x86/lib/usercopy_32.c |
409 |
+++ b/arch/x86/lib/usercopy_32.c |
410 |
@@ -43,7 +43,7 @@ do { \ |
411 |
@@ -25581,7 +25634,7 @@ index 1f118d4..fc661b0 100644 |
412 |
return n; |
413 |
} |
414 |
EXPORT_SYMBOL(__copy_from_user_ll_nozero); |
415 |
-@@ -827,59 +949,38 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr |
416 |
+@@ -827,59 +949,50 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr |
417 |
if (n > 64 && cpu_has_xmm2) |
418 |
n = __copy_user_intel_nocache(to, from, n); |
419 |
else |
420 |
@@ -25610,29 +25663,15 @@ index 1f118d4..fc661b0 100644 |
421 |
- */ |
422 |
-unsigned long |
423 |
-copy_to_user(void __user *to, const void *from, unsigned long n) |
424 |
-+#ifdef CONFIG_PAX_MEMORY_UDEREF |
425 |
-+void __set_fs(mm_segment_t x) |
426 |
++void copy_from_user_overflow(void) |
427 |
{ |
428 |
- if (access_ok(VERIFY_WRITE, to, n)) |
429 |
- n = __copy_to_user(to, from, n); |
430 |
- return n; |
431 |
-+ switch (x.seg) { |
432 |
-+ case 0: |
433 |
-+ loadsegment(gs, 0); |
434 |
-+ break; |
435 |
-+ case TASK_SIZE_MAX: |
436 |
-+ loadsegment(gs, __USER_DS); |
437 |
-+ break; |
438 |
-+ case -1UL: |
439 |
-+ loadsegment(gs, __KERNEL_DS); |
440 |
-+ break; |
441 |
-+ default: |
442 |
-+ BUG(); |
443 |
-+ } |
444 |
-+ return; |
445 |
++ WARN(1, "Buffer overflow detected!\n"); |
446 |
} |
447 |
-EXPORT_SYMBOL(copy_to_user); |
448 |
-+EXPORT_SYMBOL(__set_fs); |
449 |
++EXPORT_SYMBOL(copy_from_user_overflow); |
450 |
|
451 |
-/** |
452 |
- * copy_from_user: - Copy a block of data from user space. |
453 |
@@ -25652,21 +25691,47 @@ index 1f118d4..fc661b0 100644 |
454 |
- */ |
455 |
-unsigned long |
456 |
-copy_from_user(void *to, const void __user *from, unsigned long n) |
457 |
-+void set_fs(mm_segment_t x) |
458 |
++void copy_to_user_overflow(void) |
459 |
{ |
460 |
- if (access_ok(VERIFY_READ, from, n)) |
461 |
- n = __copy_from_user(to, from, n); |
462 |
- else |
463 |
- memset(to, 0, n); |
464 |
- return n; |
465 |
-+ current_thread_info()->addr_limit = x; |
466 |
-+ __set_fs(x); |
467 |
++ WARN(1, "Buffer overflow detected!\n"); |
468 |
} |
469 |
-EXPORT_SYMBOL(copy_from_user); |
470 |
++EXPORT_SYMBOL(copy_to_user_overflow); |
471 |
++ |
472 |
++#ifdef CONFIG_PAX_MEMORY_UDEREF |
473 |
++void __set_fs(mm_segment_t x) |
474 |
++{ |
475 |
++ switch (x.seg) { |
476 |
++ case 0: |
477 |
++ loadsegment(gs, 0); |
478 |
++ break; |
479 |
++ case TASK_SIZE_MAX: |
480 |
++ loadsegment(gs, __USER_DS); |
481 |
++ break; |
482 |
++ case -1UL: |
483 |
++ loadsegment(gs, __KERNEL_DS); |
484 |
++ break; |
485 |
++ default: |
486 |
++ BUG(); |
487 |
++ } |
488 |
++ return; |
489 |
++} |
490 |
++EXPORT_SYMBOL(__set_fs); |
491 |
++ |
492 |
++void set_fs(mm_segment_t x) |
493 |
++{ |
494 |
++ current_thread_info()->addr_limit = x; |
495 |
++ __set_fs(x); |
496 |
++} |
497 |
+EXPORT_SYMBOL(set_fs); |
498 |
+#endif |
499 |
diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c |
500 |
-index b7c2849..8633ad8 100644 |
501 |
+index b7c2849..ca4b1cb 100644 |
502 |
--- a/arch/x86/lib/usercopy_64.c |
503 |
+++ b/arch/x86/lib/usercopy_64.c |
504 |
@@ -42,6 +42,12 @@ long |
505 |
@@ -25730,6 +25795,22 @@ index b7c2849..8633ad8 100644 |
506 |
{ |
507 |
char c; |
508 |
unsigned zero_len; |
509 |
+@@ -181,3 +201,15 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest) |
510 |
+ break; |
511 |
+ return len; |
512 |
+ } |
513 |
++ |
514 |
++void copy_from_user_overflow(void) |
515 |
++{ |
516 |
++ WARN(1, "Buffer overflow detected!\n"); |
517 |
++} |
518 |
++EXPORT_SYMBOL(copy_from_user_overflow); |
519 |
++ |
520 |
++void copy_to_user_overflow(void) |
521 |
++{ |
522 |
++ WARN(1, "Buffer overflow detected!\n"); |
523 |
++} |
524 |
++EXPORT_SYMBOL(copy_to_user_overflow); |
525 |
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c |
526 |
index 61b41ca..5fef66a 100644 |
527 |
--- a/arch/x86/mm/extable.c |
528 |
@@ -85496,7 +85577,7 @@ index c8f2a5f7..1618a5c 100644 |
529 |
/* audit system wants to get cap info from files as well */ |
530 |
struct dentry; |
531 |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h |
532 |
-index 450fa59..246fa19 100644 |
533 |
+index 450fa59..7c875cb 100644 |
534 |
--- a/include/linux/compiler-gcc4.h |
535 |
+++ b/include/linux/compiler-gcc4.h |
536 |
@@ -14,6 +14,9 @@ |
537 |
@@ -85509,7 +85590,7 @@ index 450fa59..246fa19 100644 |
538 |
/* |
539 |
* A trick to suppress uninitialized variable warning without generating any |
540 |
* code |
541 |
-@@ -36,4 +39,16 @@ |
542 |
+@@ -36,4 +39,23 @@ |
543 |
the kernel context */ |
544 |
#define __cold __attribute__((__cold__)) |
545 |
|
546 |
@@ -85517,6 +85598,7 @@ index 450fa59..246fa19 100644 |
547 |
+#define __bos(ptr, arg) __builtin_object_size((ptr), (arg)) |
548 |
+#define __bos0(ptr) __bos((ptr), 0) |
549 |
+#define __bos1(ptr) __bos((ptr), 1) |
550 |
++#endif |
551 |
+ |
552 |
+#if __GNUC_MINOR__ >= 5 |
553 |
+#ifdef CONSTIFY_PLUGIN |
554 |
@@ -85525,9 +85607,15 @@ index 450fa59..246fa19 100644 |
555 |
+#endif |
556 |
+#endif |
557 |
+ |
558 |
++#if __GNUC_MINOR__ > 0 |
559 |
++#define __compiletime_object_size(obj) __builtin_object_size(obj, 0) |
560 |
++#endif |
561 |
++#if __GNUC_MINOR__ >= 4 && !defined(__CHECKER__) |
562 |
++#define __compiletime_warning(message) __attribute__((warning(message))) |
563 |
++#define __compiletime_error(message) __attribute__((error(message))) |
564 |
#endif |
565 |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h |
566 |
-index 04fb513..6189f3b 100644 |
567 |
+index 04fb513..edaeada 100644 |
568 |
--- a/include/linux/compiler.h |
569 |
+++ b/include/linux/compiler.h |
570 |
@@ -5,11 +5,14 @@ |
571 |
@@ -85621,7 +85709,27 @@ index 04fb513..6189f3b 100644 |
572 |
/* Simple shorthand for a section definition */ |
573 |
#ifndef __section |
574 |
# define __section(S) __attribute__ ((__section__(#S))) |
575 |
-@@ -278,6 +329,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); |
576 |
+@@ -266,6 +317,19 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); |
577 |
+ # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
578 |
+ #endif |
579 |
+ |
580 |
++/* Compile time object size, -1 for unknown */ |
581 |
++#ifndef __compiletime_object_size |
582 |
++# define __compiletime_object_size(obj) -1 |
583 |
++#endif |
584 |
++#ifndef __compiletime_warning |
585 |
++# define __compiletime_warning(message) |
586 |
++#endif |
587 |
++#ifndef __compiletime_error |
588 |
++# define __compiletime_error(message) |
589 |
++#endif |
590 |
++#ifndef __linktime_error |
591 |
++# define __linktime_error(message) |
592 |
++#endif |
593 |
+ /* |
594 |
+ * Prevent the compiler from merging or refetching accesses. The compiler |
595 |
+ * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
596 |
+@@ -278,6 +342,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); |
597 |
* use is to mediate communication between process-level code and irq/NMI |
598 |
* handlers, all running on the same CPU. |
599 |
*/ |
600 |
@@ -104317,7 +104425,7 @@ index 45b7d56..19e828c 100644 |
601 |
.store = foo_attr_store, |
602 |
}; |
603 |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build |
604 |
-index 341b589..405aed3 100644 |
605 |
+index 341b589..29fffe0 100644 |
606 |
--- a/scripts/Makefile.build |
607 |
+++ b/scripts/Makefile.build |
608 |
@@ -59,7 +59,7 @@ endif |
609 |
@@ -104325,7 +104433,7 @@ index 341b589..405aed3 100644 |
610 |
|
611 |
# Do not include host rules unless needed |
612 |
-ifneq ($(hostprogs-y)$(hostprogs-m),) |
613 |
-+ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m),) |
614 |
++ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) |
615 |
include scripts/Makefile.host |
616 |
endif |
617 |
|
618 |
@@ -104344,24 +104452,75 @@ index 6f89fbb..53adc9c 100644 |
619 |
# as clean-files is given relative to the current directory, this adds |
620 |
# a $(obj) prefix, except for absolute paths |
621 |
diff --git a/scripts/Makefile.host b/scripts/Makefile.host |
622 |
-index 1ac414f..a1c1451 100644 |
623 |
+index 1ac414f..38575f7 100644 |
624 |
--- a/scripts/Makefile.host |
625 |
+++ b/scripts/Makefile.host |
626 |
-@@ -31,6 +31,7 @@ |
627 |
+@@ -31,6 +31,8 @@ |
628 |
# Note: Shared libraries consisting of C++ files are not supported |
629 |
|
630 |
__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) |
631 |
+__hostlibs := $(sort $(hostlibs-y) $(hostlibs-m)) |
632 |
++__hostcxxlibs := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m)) |
633 |
|
634 |
# C code |
635 |
# Executables compiled from a single .c file |
636 |
-@@ -54,6 +55,7 @@ host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs))) |
637 |
+@@ -54,11 +56,15 @@ host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs))) |
638 |
# Shared libaries (only .c supported) |
639 |
# Shared libraries (.so) - all .so files referenced in "xxx-objs" |
640 |
host-cshlib := $(sort $(filter %.so, $(host-cobjs))) |
641 |
+host-cshlib += $(sort $(filter %.so, $(__hostlibs))) |
642 |
++host-cxxshlib := $(sort $(filter %.so, $(__hostcxxlibs))) |
643 |
# Remove .so files from "xxx-objs" |
644 |
host-cobjs := $(filter-out %.so,$(host-cobjs)) |
645 |
++host-cxxobjs := $(filter-out %.so,$(host-cxxobjs)) |
646 |
+ |
647 |
+-#Object (.o) files used by the shared libaries |
648 |
++# Object (.o) files used by the shared libaries |
649 |
+ host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) |
650 |
++host-cxxshobjs := $(sort $(foreach m,$(host-cxxshlib),$($(m:.so=-objs)))) |
651 |
+ |
652 |
+ # output directory for programs/.o files |
653 |
+ # hostprogs-y := tools/build may have been specified. Retrieve directory |
654 |
+@@ -82,7 +88,9 @@ host-cobjs := $(addprefix $(obj)/,$(host-cobjs)) |
655 |
+ host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti)) |
656 |
+ host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs)) |
657 |
+ host-cshlib := $(addprefix $(obj)/,$(host-cshlib)) |
658 |
++host-cxxshlib := $(addprefix $(obj)/,$(host-cxxshlib)) |
659 |
+ host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) |
660 |
++host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs)) |
661 |
+ host-objdirs := $(addprefix $(obj)/,$(host-objdirs)) |
662 |
+ |
663 |
+ obj-dirs += $(host-objdirs) |
664 |
+@@ -156,6 +164,13 @@ quiet_cmd_host-cshobjs = HOSTCC -fPIC $@ |
665 |
+ $(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE |
666 |
+ $(call if_changed_dep,host-cshobjs) |
667 |
+ |
668 |
++# Compile .c file, create position independent .o file |
669 |
++# host-cxxshobjs -> .o |
670 |
++quiet_cmd_host-cxxshobjs = HOSTCXX -fPIC $@ |
671 |
++ cmd_host-cxxshobjs = $(HOSTCXX) $(hostcxx_flags) -fPIC -c -o $@ $< |
672 |
++$(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE |
673 |
++ $(call if_changed_dep,host-cxxshobjs) |
674 |
++ |
675 |
+ # Link a shared library, based on position independent .o files |
676 |
+ # *.o -> .so shared library (host-cshlib) |
677 |
+ quiet_cmd_host-cshlib = HOSTLLD -shared $@ |
678 |
+@@ -165,6 +180,15 @@ quiet_cmd_host-cshlib = HOSTLLD -shared $@ |
679 |
+ $(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE |
680 |
+ $(call if_changed,host-cshlib) |
681 |
+ |
682 |
++# Link a shared library, based on position independent .o files |
683 |
++# *.o -> .so shared library (host-cxxshlib) |
684 |
++quiet_cmd_host-cxxshlib = HOSTLLD -shared $@ |
685 |
++ cmd_host-cxxshlib = $(HOSTCXX) $(HOSTLDFLAGS) -shared -o $@ \ |
686 |
++ $(addprefix $(obj)/,$($(@F:.so=-objs))) \ |
687 |
++ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) |
688 |
++$(host-cxxshlib): $(obj)/%: $(host-cxxshobjs) FORCE |
689 |
++ $(call if_changed,host-cxxshlib) |
690 |
++ |
691 |
+ targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ |
692 |
+- $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) |
693 |
++ $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) $(host-cxxshlib) $(host-cxxshobjs) |
694 |
|
695 |
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c |
696 |
index 6bf21f8..c0546b3 100644 |
697 |
@@ -104408,12 +104567,27 @@ index 6bf21f8..c0546b3 100644 |
698 |
fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", |
699 |
diff --git a/scripts/gcc-plugin.sh b/scripts/gcc-plugin.sh |
700 |
new file mode 100644 |
701 |
-index 0000000..8729101 |
702 |
+index 0000000..5a412da |
703 |
--- /dev/null |
704 |
+++ b/scripts/gcc-plugin.sh |
705 |
-@@ -0,0 +1,2 @@ |
706 |
+@@ -0,0 +1,17 @@ |
707 |
+#!/bin/sh |
708 |
-+echo -e "#include \"gcc-plugin.h\"\n#include \"tree.h\"\n#include \"tm.h\"\n#include \"rtl.h\"" | $1 -x c -shared - -o /dev/null -I`$2 -print-file-name=plugin`/include >/dev/null 2>&1 && echo "y" |
709 |
++plugincc=`$1 -x c -shared - -o /dev/null -I\`$3 -print-file-name=plugin\`/include 2>&1 <<EOF |
710 |
++#include "gcc-plugin.h" |
711 |
++#include "tree.h" |
712 |
++#include "tm.h" |
713 |
++#include "rtl.h" |
714 |
++#ifdef ENABLE_BUILD_WITH_CXX |
715 |
++#warning $2 |
716 |
++#else |
717 |
++#warning $1 |
718 |
++#endif |
719 |
++EOF` |
720 |
++if [ $? -eq 0 ] |
721 |
++then |
722 |
++ [[ "$plugincc" =~ "$1" ]] && echo $1 |
723 |
++ [[ "$plugincc" =~ "$2" ]] && echo $2 |
724 |
++fi |
725 |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c |
726 |
index 62a9025..65b82ad 100644 |
727 |
--- a/scripts/mod/file2alias.c |
728 |
@@ -106609,28 +106783,33 @@ index 79633ea..9732e90 100644 |
729 |
} |
730 |
diff --git a/tools/gcc/Makefile b/tools/gcc/Makefile |
731 |
new file mode 100644 |
732 |
-index 0000000..ca64170 |
733 |
+index 0000000..991f33b |
734 |
--- /dev/null |
735 |
+++ b/tools/gcc/Makefile |
736 |
-@@ -0,0 +1,26 @@ |
737 |
+@@ -0,0 +1,31 @@ |
738 |
+#CC := gcc |
739 |
+#PLUGIN_SOURCE_FILES := pax_plugin.c |
740 |
+#PLUGIN_OBJECT_FILES := $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES)) |
741 |
+GCCPLUGINS_DIR := $(shell $(CC) -print-file-name=plugin) |
742 |
+#CFLAGS += -I$(GCCPLUGINS_DIR)/include -fPIC -O2 -Wall -W -std=gnu99 |
743 |
+ |
744 |
++ifeq ($(PLUGINCC),$(HOSTCC)) |
745 |
++HOSTLIBS := hostlibs |
746 |
+HOST_EXTRACFLAGS += -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family -std=gnu99 -ggdb |
747 |
-+CFLAGS_size_overflow_plugin.o := -Wno-missing-initializer |
748 |
++else |
749 |
++HOSTLIBS := hostcxxlibs |
750 |
++HOST_EXTRACXXFLAGS += -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family -std=gnu++98 -ggdb -Wno-unused-parameter |
751 |
++endif |
752 |
+ |
753 |
-+hostlibs-y := constify_plugin.so |
754 |
-+hostlibs-$(CONFIG_PAX_MEMORY_STACKLEAK) += stackleak_plugin.so |
755 |
-+hostlibs-$(CONFIG_KALLOCSTAT_PLUGIN) += kallocstat_plugin.so |
756 |
-+hostlibs-$(CONFIG_PAX_KERNEXEC_PLUGIN) += kernexec_plugin.so |
757 |
-+hostlibs-$(CONFIG_CHECKER_PLUGIN) += checker_plugin.so |
758 |
-+hostlibs-y += colorize_plugin.so |
759 |
-+hostlibs-$(CONFIG_PAX_SIZE_OVERFLOW) += size_overflow_plugin.so |
760 |
++$(HOSTLIBS)-y := constify_plugin.so |
761 |
++$(HOSTLIBS)-$(CONFIG_PAX_MEMORY_STACKLEAK) += stackleak_plugin.so |
762 |
++$(HOSTLIBS)-$(CONFIG_KALLOCSTAT_PLUGIN) += kallocstat_plugin.so |
763 |
++$(HOSTLIBS)-$(CONFIG_PAX_KERNEXEC_PLUGIN) += kernexec_plugin.so |
764 |
++$(HOSTLIBS)-$(CONFIG_CHECKER_PLUGIN) += checker_plugin.so |
765 |
++$(HOSTLIBS)-y += colorize_plugin.so |
766 |
++$(HOSTLIBS)-$(CONFIG_PAX_SIZE_OVERFLOW) += size_overflow_plugin.so |
767 |
+ |
768 |
-+always := $(hostlibs-y) |
769 |
++always := $($(HOSTLIBS)-y) |
770 |
+ |
771 |
+constify_plugin-objs := constify_plugin.o |
772 |
+stackleak_plugin-objs := stackleak_plugin.o |
773 |
@@ -106818,10 +106997,10 @@ index 0000000..d41b5af |
774 |
+} |
775 |
diff --git a/tools/gcc/colorize_plugin.c b/tools/gcc/colorize_plugin.c |
776 |
new file mode 100644 |
777 |
-index 0000000..ee950d0 |
778 |
+index 0000000..7a5e311 |
779 |
--- /dev/null |
780 |
+++ b/tools/gcc/colorize_plugin.c |
781 |
-@@ -0,0 +1,147 @@ |
782 |
+@@ -0,0 +1,148 @@ |
783 |
+/* |
784 |
+ * Copyright 2012 by PaX Team <pageexec@××××××××.hu> |
785 |
+ * Licensed under the GPL v2 |
786 |
@@ -106853,6 +107032,7 @@ index 0000000..ee950d0 |
787 |
+ |
788 |
+static struct plugin_info colorize_plugin_info = { |
789 |
+ .version = "201203092200", |
790 |
++ .help = NULL, |
791 |
+}; |
792 |
+ |
793 |
+#define GREEN "\033[32m\033[2m" |
794 |
@@ -121183,10 +121363,10 @@ index 0000000..604f3f0 |
795 |
+}; |
796 |
diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c |
797 |
new file mode 100644 |
798 |
-index 0000000..9ad0f39 |
799 |
+index 0000000..273e66a |
800 |
--- /dev/null |
801 |
+++ b/tools/gcc/size_overflow_plugin.c |
802 |
-@@ -0,0 +1,1221 @@ |
803 |
+@@ -0,0 +1,1203 @@ |
804 |
+/* |
805 |
+ * Copyright 2011, 2012 by Emese Revfy <re.emese@×××××.com> |
806 |
+ * Licensed under the GPL v2, or (at your option) v3 |
807 |
@@ -121199,7 +121379,7 @@ index 0000000..9ad0f39 |
808 |
+ * The recomputed argument is checked against TYPE_MAX and an event is logged on overflow and the triggering process is killed. |
809 |
+ * |
810 |
+ * Usage: |
811 |
-+ * $ gcc -I`gcc -print-file-name=plugin`/include -fPIC -shared -O2 -o size_overflow_plugin.so size_overflow_plugin.c |
812 |
++ * $ gcc -I`gcc -print-file-name=plugin`/include/c-family -I`gcc -print-file-name=plugin`/include -fPIC -shared -O2 -ggdb -Wall -W -Wno-missing-field-initializers -o size_overflow_plugin.so size_overflow_plugin.c |
813 |
+ * $ gcc -fplugin=size_overflow_plugin.so test.c -O2 |
814 |
+ */ |
815 |
+ |
816 |
@@ -121253,8 +121433,8 @@ index 0000000..9ad0f39 |
817 |
+static unsigned int handle_function(void); |
818 |
+ |
819 |
+static struct plugin_info size_overflow_plugin_info = { |
820 |
-+ .version = "20120612beta", |
821 |
-+ .help = "no-size_overflow\tturn off size overflow checking\n", |
822 |
++ .version = "20120617beta", |
823 |
++ .help = "no-size-overflow\tturn off size overflow checking\n", |
824 |
+}; |
825 |
+ |
826 |
+static tree handle_size_overflow_attribute(tree *node, tree __unused name, tree args, int __unused flags, bool *no_add_attrs) |
827 |
@@ -121279,6 +121459,9 @@ index 0000000..9ad0f39 |
828 |
+ .type_required = true, |
829 |
+ .function_type_required = true, |
830 |
+ .handler = handle_size_overflow_attribute |
831 |
++#if BUILDING_GCC_VERSION >= 4007 |
832 |
++ .affects_type_identity = false |
833 |
++#endif |
834 |
+}; |
835 |
+ |
836 |
+static void register_attributes(void __unused *event_data, void __unused *data) |
837 |
@@ -121539,11 +121722,17 @@ index 0000000..9ad0f39 |
838 |
+ |
839 |
+static tree cast_a_tree(tree type, tree var) |
840 |
+{ |
841 |
++ gcc_assert(type != NULL_TREE && var != NULL_TREE); |
842 |
+ gcc_assert(fold_convertible_p(type, var)); |
843 |
+ |
844 |
+ return fold_convert(type, var); |
845 |
+} |
846 |
+ |
847 |
++static tree signed_cast(tree var) |
848 |
++{ |
849 |
++ return cast_a_tree(signed_size_overflow_type, var); |
850 |
++} |
851 |
++ |
852 |
+static gimple build_cast_stmt(tree type, tree var, tree new_var, location_t loc) |
853 |
+{ |
854 |
+ gimple assign; |
855 |
@@ -121642,7 +121831,7 @@ index 0000000..9ad0f39 |
856 |
+ |
857 |
+ if (rhs1 != NULL_TREE) { |
858 |
+ if (!gimple_assign_cast_p(oldstmt)) |
859 |
-+ rhs1 = cast_a_tree(signed_size_overflow_type, rhs1); |
860 |
++ rhs1 = signed_cast(rhs1); |
861 |
+ gimple_assign_set_rhs1(stmt, rhs1); |
862 |
+ } |
863 |
+ |
864 |
@@ -121680,13 +121869,6 @@ index 0000000..9ad0f39 |
865 |
+ return phi; |
866 |
+} |
867 |
+ |
868 |
-+static tree signed_cast_constant(tree node) |
869 |
-+{ |
870 |
-+ gcc_assert(is_gimple_constant(node)); |
871 |
-+ |
872 |
-+ return cast_a_tree(signed_size_overflow_type, node); |
873 |
-+} |
874 |
-+ |
875 |
+static basic_block create_a_first_bb(void) |
876 |
+{ |
877 |
+ basic_block first_bb; |
878 |
@@ -121782,7 +121964,7 @@ index 0000000..9ad0f39 |
879 |
+ |
880 |
+ arg = gimple_phi_arg_def(oldstmt, i); |
881 |
+ if (is_gimple_constant(arg)) |
882 |
-+ arg = signed_cast_constant(arg); |
883 |
++ arg = signed_cast(arg); |
884 |
+ lhs = build_new_phi_arg(visited, potentionally_overflowed, arg, new_var); |
885 |
+ if (lhs == NULL_TREE) |
886 |
+ lhs = gimple_get_lhs(cast_old_phi_arg(oldstmt, arg, new_var, i)); |
887 |
@@ -121815,7 +121997,7 @@ index 0000000..9ad0f39 |
888 |
+ tree rhs1 = gimple_assign_rhs1(def_stmt); |
889 |
+ |
890 |
+ if (is_gimple_constant(rhs1)) |
891 |
-+ return dup_assign(visited, potentionally_overflowed, def_stmt, signed_cast_constant(rhs1), NULL_TREE, NULL_TREE); |
892 |
++ return dup_assign(visited, potentionally_overflowed, def_stmt, signed_cast(rhs1), NULL_TREE, NULL_TREE); |
893 |
+ |
894 |
+ gcc_assert(TREE_CODE(rhs1) != COND_EXPR); |
895 |
+ switch (TREE_CODE(rhs1)) { |
896 |
@@ -121944,19 +122126,6 @@ index 0000000..9ad0f39 |
897 |
+// print_the_code_insertions(stmt); |
898 |
+} |
899 |
+ |
900 |
-+static tree get_type_for_check(tree rhs) |
901 |
-+{ |
902 |
-+ tree def_rhs; |
903 |
-+ gimple def_stmt = get_def_stmt(rhs); |
904 |
-+ |
905 |
-+ if (!gimple_assign_cast_p(def_stmt)) |
906 |
-+ return TREE_TYPE(rhs); |
907 |
-+ def_rhs = gimple_assign_rhs1(def_stmt); |
908 |
-+ if (TREE_CODE(TREE_TYPE(def_rhs)) == INTEGER_TYPE) |
909 |
-+ return TREE_TYPE(def_rhs); |
910 |
-+ return TREE_TYPE(rhs); |
911 |
-+} |
912 |
-+ |
913 |
+static gimple cast_to_unsigned_size_overflow_type(gimple stmt, tree cast_rhs) |
914 |
+{ |
915 |
+ gimple ucast_stmt; |
916 |
@@ -121971,61 +122140,54 @@ index 0000000..9ad0f39 |
917 |
+ |
918 |
+static void check_size_overflow(gimple stmt, tree cast_rhs, tree rhs, bool *potentionally_overflowed) |
919 |
+{ |
920 |
-+ tree type_max, type_min, rhs_type; |
921 |
++ tree type_max, type_min, rhs_type = TREE_TYPE(rhs); |
922 |
+ gimple ucast_stmt; |
923 |
+ |
924 |
+ if (!*potentionally_overflowed) |
925 |
+ return; |
926 |
+ |
927 |
-+ rhs_type = get_type_for_check(rhs); |
928 |
-+ |
929 |
+ if (TYPE_UNSIGNED(rhs_type)) { |
930 |
+ ucast_stmt = cast_to_unsigned_size_overflow_type(stmt, cast_rhs); |
931 |
+ type_max = cast_a_tree(unsigned_size_overflow_type, TYPE_MAX_VALUE(rhs_type)); |
932 |
+ insert_check_size_overflow(stmt, GT_EXPR, gimple_get_lhs(ucast_stmt), type_max); |
933 |
+ } else { |
934 |
-+ type_max = cast_a_tree(signed_size_overflow_type, TYPE_MAX_VALUE(rhs_type)); |
935 |
++ type_max = signed_cast(TYPE_MAX_VALUE(rhs_type)); |
936 |
+ insert_check_size_overflow(stmt, GT_EXPR, cast_rhs, type_max); |
937 |
+ |
938 |
-+ type_min = cast_a_tree(signed_size_overflow_type, TYPE_MIN_VALUE(rhs_type)); |
939 |
++ type_min = signed_cast(TYPE_MIN_VALUE(rhs_type)); |
940 |
+ insert_check_size_overflow(stmt, LT_EXPR, cast_rhs, type_min); |
941 |
+ } |
942 |
+} |
943 |
+ |
944 |
-+static tree change_assign_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple stmt, tree orig_rhs) |
945 |
++static tree change_assign_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple stmt, tree orig_rhs, tree new_rhs) |
946 |
+{ |
947 |
+ gimple assign; |
948 |
+ gimple_stmt_iterator gsi = gsi_for_stmt(stmt); |
949 |
-+ tree new_rhs, origtype = TREE_TYPE(orig_rhs); |
950 |
++ tree origtype = TREE_TYPE(orig_rhs); |
951 |
+ |
952 |
+ gcc_assert(gimple_code(stmt) == GIMPLE_ASSIGN); |
953 |
+ |
954 |
-+ new_rhs = expand(visited, potentionally_overflowed, orig_rhs); |
955 |
-+ if (new_rhs == NULL_TREE) |
956 |
-+ return NULL_TREE; |
957 |
-+ |
958 |
+ assign = build_cast_stmt(origtype, new_rhs, CREATE_NEW_VAR, gimple_location(stmt)); |
959 |
+ gsi_insert_before(&gsi, assign, GSI_SAME_STMT); |
960 |
+ update_stmt(assign); |
961 |
+ return gimple_get_lhs(assign); |
962 |
+} |
963 |
+ |
964 |
-+static tree handle_const_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple def_stmt, tree var, tree rhs, tree new_rhs1, tree new_rhs2, void (*gimple_assign_set_rhs)(gimple, tree)) |
965 |
++static tree handle_const_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple def_stmt, tree var, tree orig_rhs, tree var_rhs, tree new_rhs1, tree new_rhs2, void (*gimple_assign_set_rhs)(gimple, tree)) |
966 |
+{ |
967 |
-+ tree new_rhs, cast_rhs; |
968 |
++ tree new_rhs; |
969 |
+ |
970 |
+ if (gimple_assign_rhs_code(def_stmt) == MIN_EXPR) |
971 |
+ return dup_assign(visited, potentionally_overflowed, def_stmt, new_rhs1, new_rhs2, NULL_TREE); |
972 |
+ |
973 |
-+ new_rhs = change_assign_rhs(visited, potentionally_overflowed, def_stmt, rhs); |
974 |
-+ if (new_rhs != NULL_TREE) { |
975 |
-+ gimple_assign_set_rhs(def_stmt, new_rhs); |
976 |
-+ update_stmt(def_stmt); |
977 |
++ if (var_rhs == NULL_TREE) |
978 |
++ return create_assign(visited, potentionally_overflowed, def_stmt, var, AFTER_STMT); |
979 |
+ |
980 |
-+ cast_rhs = gimple_assign_rhs1(get_def_stmt(new_rhs)); |
981 |
++ new_rhs = change_assign_rhs(visited, potentionally_overflowed, def_stmt, orig_rhs, var_rhs); |
982 |
++ gimple_assign_set_rhs(def_stmt, new_rhs); |
983 |
++ update_stmt(def_stmt); |
984 |
+ |
985 |
-+ check_size_overflow(def_stmt, cast_rhs, rhs, potentionally_overflowed); |
986 |
-+ } |
987 |
++ check_size_overflow(def_stmt, var_rhs, orig_rhs, potentionally_overflowed); |
988 |
+ return create_assign(visited, potentionally_overflowed, def_stmt, var, AFTER_STMT); |
989 |
+} |
990 |
+ |
991 |
@@ -122066,10 +122228,10 @@ index 0000000..9ad0f39 |
992 |
+ new_rhs2 = expand(visited, potentionally_overflowed, rhs2); |
993 |
+ |
994 |
+ if (is_gimple_constant(rhs2)) |
995 |
-+ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs1, new_rhs1, signed_cast_constant(rhs2), &gimple_assign_set_rhs1); |
996 |
++ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs1, new_rhs1, new_rhs1, signed_cast(rhs2), &gimple_assign_set_rhs1); |
997 |
+ |
998 |
+ if (is_gimple_constant(rhs1)) |
999 |
-+ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs2, signed_cast_constant(rhs1), new_rhs2, &gimple_assign_set_rhs2); |
1000 |
++ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs2, new_rhs2, signed_cast(rhs1), new_rhs2, &gimple_assign_set_rhs2); |
1001 |
+ |
1002 |
+ return dup_assign(visited, potentionally_overflowed, def_stmt, new_rhs1, new_rhs2, NULL_TREE); |
1003 |
+} |
1004 |
@@ -122078,7 +122240,7 @@ index 0000000..9ad0f39 |
1005 |
+static tree get_new_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, tree rhs) |
1006 |
+{ |
1007 |
+ if (is_gimple_constant(rhs)) |
1008 |
-+ return signed_cast_constant(rhs); |
1009 |
++ return signed_cast(rhs); |
1010 |
+ if (TREE_CODE(rhs) != SSA_NAME) |
1011 |
+ return NULL_TREE; |
1012 |
+ return expand(visited, potentionally_overflowed, rhs); |
1013 |
|
1014 |
diff --git a/3.2.20/0000_README b/3.2.20/0000_README |
1015 |
index fb633c6..032419d 100644 |
1016 |
--- a/3.2.20/0000_README |
1017 |
+++ b/3.2.20/0000_README |
1018 |
@@ -6,7 +6,7 @@ Patch: 1019_linux-3.2.20.patch |
1019 |
From: http://www.kernel.org |
1020 |
Desc: Linux 3.2.20 |
1021 |
|
1022 |
-Patch: 4420_grsecurity-2.9.1-3.2.20-201206160836.patch |
1023 |
+Patch: 4420_grsecurity-2.9.1-3.2.20-201206171957.patch |
1024 |
From: http://www.grsecurity.net |
1025 |
Desc: hardened-sources base patch from upstream grsecurity |
1026 |
|
1027 |
|
1028 |
diff --git a/3.2.20/4420_grsecurity-2.9.1-3.2.20-201206160836.patch b/3.2.20/4420_grsecurity-2.9.1-3.2.20-201206171957.patch |
1029 |
similarity index 99% |
1030 |
rename from 3.2.20/4420_grsecurity-2.9.1-3.2.20-201206160836.patch |
1031 |
rename to 3.2.20/4420_grsecurity-2.9.1-3.2.20-201206171957.patch |
1032 |
index 5d95369..e582270 100644 |
1033 |
--- a/3.2.20/4420_grsecurity-2.9.1-3.2.20-201206160836.patch |
1034 |
+++ b/3.2.20/4420_grsecurity-2.9.1-3.2.20-201206171957.patch |
1035 |
@@ -203,7 +203,7 @@ index 81c287f..d456d02 100644 |
1036 |
|
1037 |
pcd. [PARIDE] |
1038 |
diff --git a/Makefile b/Makefile |
1039 |
-index c7e9cc4..8448a0f 100644 |
1040 |
+index c7e9cc4..7ce8f8d 100644 |
1041 |
--- a/Makefile |
1042 |
+++ b/Makefile |
1043 |
@@ -245,8 +245,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
1044 |
@@ -229,12 +229,13 @@ index c7e9cc4..8448a0f 100644 |
1045 |
$(Q)$(MAKE) $(build)=scripts/basic |
1046 |
$(Q)rm -f .tmp_quiet_recordmcount |
1047 |
|
1048 |
-@@ -564,6 +565,55 @@ else |
1049 |
+@@ -564,6 +565,56 @@ else |
1050 |
KBUILD_CFLAGS += -O2 |
1051 |
endif |
1052 |
|
1053 |
+ifndef DISABLE_PAX_PLUGINS |
1054 |
-+ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(CC)"), y) |
1055 |
++PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(HOSTCXX)" "$(CC)") |
1056 |
++ifneq ($(PLUGINCC),) |
1057 |
+ifndef DISABLE_PAX_CONSTIFY_PLUGIN |
1058 |
+ifndef CONFIG_UML |
1059 |
+CONSTIFY_PLUGIN_CFLAGS := -fplugin=$(objtree)/tools/gcc/constify_plugin.so -DCONSTIFY_PLUGIN |
1060 |
@@ -264,7 +265,7 @@ index c7e9cc4..8448a0f 100644 |
1061 |
+GCC_PLUGINS_CFLAGS := $(CONSTIFY_PLUGIN_CFLAGS) $(STACKLEAK_PLUGIN_CFLAGS) $(KALLOCSTAT_PLUGIN_CFLAGS) |
1062 |
+GCC_PLUGINS_CFLAGS += $(KERNEXEC_PLUGIN_CFLAGS) $(CHECKER_PLUGIN_CFLAGS) $(COLORIZE_PLUGIN_CFLAGS) $(SIZE_OVERFLOW_PLUGIN_CFLAGS) |
1063 |
+GCC_PLUGINS_AFLAGS := $(KERNEXEC_PLUGIN_AFLAGS) |
1064 |
-+export CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN CHECKER_PLUGIN SIZE_OVERFLOW_PLUGIN |
1065 |
++export PLUGINCC CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN CHECKER_PLUGIN SIZE_OVERFLOW_PLUGIN |
1066 |
+ifeq ($(KBUILD_EXTMOD),) |
1067 |
+gcc-plugins: |
1068 |
+ $(Q)$(MAKE) $(build)=tools/gcc |
1069 |
@@ -285,7 +286,7 @@ index c7e9cc4..8448a0f 100644 |
1070 |
include $(srctree)/arch/$(SRCARCH)/Makefile |
1071 |
|
1072 |
ifneq ($(CONFIG_FRAME_WARN),0) |
1073 |
-@@ -708,7 +758,7 @@ export mod_strip_cmd |
1074 |
+@@ -708,7 +759,7 @@ export mod_strip_cmd |
1075 |
|
1076 |
|
1077 |
ifeq ($(KBUILD_EXTMOD),) |
1078 |
@@ -294,7 +295,7 @@ index c7e9cc4..8448a0f 100644 |
1079 |
|
1080 |
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ |
1081 |
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \ |
1082 |
-@@ -932,6 +982,8 @@ vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE |
1083 |
+@@ -932,6 +983,8 @@ vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE |
1084 |
|
1085 |
# The actual objects are generated when descending, |
1086 |
# make sure no implicit rule kicks in |
1087 |
@@ -303,7 +304,7 @@ index c7e9cc4..8448a0f 100644 |
1088 |
$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; |
1089 |
|
1090 |
# Handle descending into subdirectories listed in $(vmlinux-dirs) |
1091 |
-@@ -941,7 +993,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; |
1092 |
+@@ -941,7 +994,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; |
1093 |
# Error messages still appears in the original language |
1094 |
|
1095 |
PHONY += $(vmlinux-dirs) |
1096 |
@@ -312,7 +313,7 @@ index c7e9cc4..8448a0f 100644 |
1097 |
$(Q)$(MAKE) $(build)=$@ |
1098 |
|
1099 |
# Store (new) KERNELRELASE string in include/config/kernel.release |
1100 |
-@@ -985,6 +1037,7 @@ prepare0: archprepare FORCE |
1101 |
+@@ -985,6 +1038,7 @@ prepare0: archprepare FORCE |
1102 |
$(Q)$(MAKE) $(build)=. |
1103 |
|
1104 |
# All the preparing.. |
1105 |
@@ -320,7 +321,7 @@ index c7e9cc4..8448a0f 100644 |
1106 |
prepare: prepare0 |
1107 |
|
1108 |
# Generate some files |
1109 |
-@@ -1089,6 +1142,8 @@ all: modules |
1110 |
+@@ -1089,6 +1143,8 @@ all: modules |
1111 |
# using awk while concatenating to the final file. |
1112 |
|
1113 |
PHONY += modules |
1114 |
@@ -329,7 +330,7 @@ index c7e9cc4..8448a0f 100644 |
1115 |
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin |
1116 |
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order |
1117 |
@$(kecho) ' Building modules, stage 2.'; |
1118 |
-@@ -1104,7 +1159,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) |
1119 |
+@@ -1104,7 +1160,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) |
1120 |
|
1121 |
# Target to prepare building external modules |
1122 |
PHONY += modules_prepare |
1123 |
@@ -338,7 +339,7 @@ index c7e9cc4..8448a0f 100644 |
1124 |
|
1125 |
# Target to install modules |
1126 |
PHONY += modules_install |
1127 |
-@@ -1201,6 +1256,7 @@ distclean: mrproper |
1128 |
+@@ -1201,6 +1257,7 @@ distclean: mrproper |
1129 |
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \ |
1130 |
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ |
1131 |
-o -name '.*.rej' \ |
1132 |
@@ -346,7 +347,7 @@ index c7e9cc4..8448a0f 100644 |
1133 |
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ |
1134 |
-type f -print | xargs rm -f |
1135 |
|
1136 |
-@@ -1361,6 +1417,8 @@ PHONY += $(module-dirs) modules |
1137 |
+@@ -1361,6 +1418,8 @@ PHONY += $(module-dirs) modules |
1138 |
$(module-dirs): crmodverdir $(objtree)/Module.symvers |
1139 |
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) |
1140 |
|
1141 |
@@ -355,7 +356,7 @@ index c7e9cc4..8448a0f 100644 |
1142 |
modules: $(module-dirs) |
1143 |
@$(kecho) ' Building modules, stage 2.'; |
1144 |
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
1145 |
-@@ -1487,17 +1545,21 @@ else |
1146 |
+@@ -1487,17 +1546,21 @@ else |
1147 |
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) |
1148 |
endif |
1149 |
|
1150 |
@@ -381,7 +382,7 @@ index c7e9cc4..8448a0f 100644 |
1151 |
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1152 |
%.symtypes: %.c prepare scripts FORCE |
1153 |
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1154 |
-@@ -1507,11 +1569,15 @@ endif |
1155 |
+@@ -1507,11 +1570,15 @@ endif |
1156 |
$(cmd_crmodverdir) |
1157 |
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
1158 |
$(build)=$(build-dir) |
1159 |
@@ -12976,7 +12977,7 @@ index 566e803..ce99a01 100644 |
1160 |
} |
1161 |
|
1162 |
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h |
1163 |
-index 1c66d30..bf1a2cc 100644 |
1164 |
+index 1c66d30..d0f1634 100644 |
1165 |
--- a/arch/x86/include/asm/uaccess_64.h |
1166 |
+++ b/arch/x86/include/asm/uaccess_64.h |
1167 |
@@ -10,6 +10,9 @@ |
1168 |
@@ -13007,7 +13008,7 @@ index 1c66d30..bf1a2cc 100644 |
1169 |
{ |
1170 |
unsigned ret; |
1171 |
|
1172 |
-@@ -32,142 +37,226 @@ copy_user_generic(void *to, const void *from, unsigned len) |
1173 |
+@@ -32,142 +37,238 @@ copy_user_generic(void *to, const void *from, unsigned len) |
1174 |
ASM_OUTPUT2("=a" (ret), "=D" (to), "=S" (from), |
1175 |
"=d" (len)), |
1176 |
"1" (to), "2" (from), "3" (len) |
1177 |
@@ -13027,6 +13028,22 @@ index 1c66d30..bf1a2cc 100644 |
1178 |
-__must_check unsigned long |
1179 |
-copy_in_user(void __user *to, const void __user *from, unsigned len); |
1180 |
+copy_in_user(void __user *to, const void __user *from, unsigned long len) __size_overflow(3); |
1181 |
++ |
1182 |
++extern void copy_to_user_overflow(void) |
1183 |
++#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS |
1184 |
++ __compiletime_error("copy_to_user() buffer size is not provably correct") |
1185 |
++#else |
1186 |
++ __compiletime_warning("copy_to_user() buffer size is not provably correct") |
1187 |
++#endif |
1188 |
++; |
1189 |
++ |
1190 |
++extern void copy_from_user_overflow(void) |
1191 |
++#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS |
1192 |
++ __compiletime_error("copy_from_user() buffer size is not provably correct") |
1193 |
++#else |
1194 |
++ __compiletime_warning("copy_from_user() buffer size is not provably correct") |
1195 |
++#endif |
1196 |
++; |
1197 |
|
1198 |
static inline unsigned long __must_check copy_from_user(void *to, |
1199 |
const void __user *from, |
1200 |
@@ -13085,9 +13102,7 @@ index 1c66d30..bf1a2cc 100644 |
1201 |
+#endif |
1202 |
+ |
1203 |
+ if (unlikely(sz != -1 && sz < size)) { |
1204 |
-+#ifdef CONFIG_DEBUG_VM |
1205 |
-+ WARN(1, "Buffer overflow detected!\n"); |
1206 |
-+#endif |
1207 |
++ copy_from_user_overflow(); |
1208 |
+ return size; |
1209 |
+ } |
1210 |
+ |
1211 |
@@ -13173,9 +13188,7 @@ index 1c66d30..bf1a2cc 100644 |
1212 |
+#endif |
1213 |
+ |
1214 |
+ if (unlikely(sz != -1 && sz < size)) { |
1215 |
-+#ifdef CONFIG_DEBUG_VM |
1216 |
-+ WARN(1, "Buffer overflow detected!\n"); |
1217 |
-+#endif |
1218 |
++ copy_to_user_overflow(); |
1219 |
+ return size; |
1220 |
+ } |
1221 |
+ |
1222 |
@@ -13282,7 +13295,7 @@ index 1c66d30..bf1a2cc 100644 |
1223 |
ret, "b", "b", "=q", 1); |
1224 |
if (likely(!ret)) |
1225 |
__put_user_asm(tmp, (u8 __user *)dst, |
1226 |
-@@ -176,7 +265,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
1227 |
+@@ -176,7 +277,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
1228 |
} |
1229 |
case 2: { |
1230 |
u16 tmp; |
1231 |
@@ -13291,7 +13304,7 @@ index 1c66d30..bf1a2cc 100644 |
1232 |
ret, "w", "w", "=r", 2); |
1233 |
if (likely(!ret)) |
1234 |
__put_user_asm(tmp, (u16 __user *)dst, |
1235 |
-@@ -186,7 +275,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
1236 |
+@@ -186,7 +287,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
1237 |
|
1238 |
case 4: { |
1239 |
u32 tmp; |
1240 |
@@ -13300,7 +13313,7 @@ index 1c66d30..bf1a2cc 100644 |
1241 |
ret, "l", "k", "=r", 4); |
1242 |
if (likely(!ret)) |
1243 |
__put_user_asm(tmp, (u32 __user *)dst, |
1244 |
-@@ -195,7 +284,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
1245 |
+@@ -195,7 +296,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
1246 |
} |
1247 |
case 8: { |
1248 |
u64 tmp; |
1249 |
@@ -13309,7 +13322,7 @@ index 1c66d30..bf1a2cc 100644 |
1250 |
ret, "q", "", "=r", 8); |
1251 |
if (likely(!ret)) |
1252 |
__put_user_asm(tmp, (u64 __user *)dst, |
1253 |
-@@ -203,8 +292,16 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
1254 |
+@@ -203,8 +304,16 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) |
1255 |
return ret; |
1256 |
} |
1257 |
default: |
1258 |
@@ -13328,7 +13341,7 @@ index 1c66d30..bf1a2cc 100644 |
1259 |
} |
1260 |
} |
1261 |
|
1262 |
-@@ -215,39 +312,76 @@ __strncpy_from_user(char *dst, const char __user *src, long count); |
1263 |
+@@ -215,39 +324,76 @@ __strncpy_from_user(char *dst, const char __user *src, long count); |
1264 |
__must_check long strnlen_user(const char __user *str, long n); |
1265 |
__must_check long __strnlen_user(const char __user *str, long n); |
1266 |
__must_check long strlen_user(const char __user *str); |
1267 |
@@ -23508,7 +23521,7 @@ index e218d5d..a99a1eb 100644 |
1268 |
+EXPORT_SYMBOL(set_fs); |
1269 |
+#endif |
1270 |
diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c |
1271 |
-index b7c2849..8633ad8 100644 |
1272 |
+index b7c2849..ca4b1cb 100644 |
1273 |
--- a/arch/x86/lib/usercopy_64.c |
1274 |
+++ b/arch/x86/lib/usercopy_64.c |
1275 |
@@ -42,6 +42,12 @@ long |
1276 |
@@ -23572,6 +23585,22 @@ index b7c2849..8633ad8 100644 |
1277 |
{ |
1278 |
char c; |
1279 |
unsigned zero_len; |
1280 |
+@@ -181,3 +201,15 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest) |
1281 |
+ break; |
1282 |
+ return len; |
1283 |
+ } |
1284 |
++ |
1285 |
++void copy_from_user_overflow(void) |
1286 |
++{ |
1287 |
++ WARN(1, "Buffer overflow detected!\n"); |
1288 |
++} |
1289 |
++EXPORT_SYMBOL(copy_from_user_overflow); |
1290 |
++ |
1291 |
++void copy_to_user_overflow(void) |
1292 |
++{ |
1293 |
++ WARN(1, "Buffer overflow detected!\n"); |
1294 |
++} |
1295 |
++EXPORT_SYMBOL(copy_to_user_overflow); |
1296 |
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c |
1297 |
index d0474ad..36e9257 100644 |
1298 |
--- a/arch/x86/mm/extable.c |
1299 |
@@ -79152,7 +79181,7 @@ index 0174034..65eaf78 100644 |
1300 |
} |
1301 |
|
1302 |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build |
1303 |
-index d2b366c..51ff91ebc 100644 |
1304 |
+index d2b366c..2d5a6f8 100644 |
1305 |
--- a/scripts/Makefile.build |
1306 |
+++ b/scripts/Makefile.build |
1307 |
@@ -109,7 +109,7 @@ endif |
1308 |
@@ -79160,7 +79189,7 @@ index d2b366c..51ff91ebc 100644 |
1309 |
|
1310 |
# Do not include host rules unless needed |
1311 |
-ifneq ($(hostprogs-y)$(hostprogs-m),) |
1312 |
-+ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m),) |
1313 |
++ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) |
1314 |
include scripts/Makefile.host |
1315 |
endif |
1316 |
|
1317 |
@@ -79221,24 +79250,75 @@ index a57f5bd..d3bae5e 100644 |
1318 |
echo "\#include <asm-generic/$$F>" > $(install)/$$F; \ |
1319 |
done; \ |
1320 |
diff --git a/scripts/Makefile.host b/scripts/Makefile.host |
1321 |
-index 1ac414f..a1c1451 100644 |
1322 |
+index 1ac414f..38575f7 100644 |
1323 |
--- a/scripts/Makefile.host |
1324 |
+++ b/scripts/Makefile.host |
1325 |
-@@ -31,6 +31,7 @@ |
1326 |
+@@ -31,6 +31,8 @@ |
1327 |
# Note: Shared libraries consisting of C++ files are not supported |
1328 |
|
1329 |
__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) |
1330 |
+__hostlibs := $(sort $(hostlibs-y) $(hostlibs-m)) |
1331 |
++__hostcxxlibs := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m)) |
1332 |
|
1333 |
# C code |
1334 |
# Executables compiled from a single .c file |
1335 |
-@@ -54,6 +55,7 @@ host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs))) |
1336 |
+@@ -54,11 +56,15 @@ host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs))) |
1337 |
# Shared libaries (only .c supported) |
1338 |
# Shared libraries (.so) - all .so files referenced in "xxx-objs" |
1339 |
host-cshlib := $(sort $(filter %.so, $(host-cobjs))) |
1340 |
+host-cshlib += $(sort $(filter %.so, $(__hostlibs))) |
1341 |
++host-cxxshlib := $(sort $(filter %.so, $(__hostcxxlibs))) |
1342 |
# Remove .so files from "xxx-objs" |
1343 |
host-cobjs := $(filter-out %.so,$(host-cobjs)) |
1344 |
++host-cxxobjs := $(filter-out %.so,$(host-cxxobjs)) |
1345 |
+ |
1346 |
+-#Object (.o) files used by the shared libaries |
1347 |
++# Object (.o) files used by the shared libaries |
1348 |
+ host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) |
1349 |
++host-cxxshobjs := $(sort $(foreach m,$(host-cxxshlib),$($(m:.so=-objs)))) |
1350 |
+ |
1351 |
+ # output directory for programs/.o files |
1352 |
+ # hostprogs-y := tools/build may have been specified. Retrieve directory |
1353 |
+@@ -82,7 +88,9 @@ host-cobjs := $(addprefix $(obj)/,$(host-cobjs)) |
1354 |
+ host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti)) |
1355 |
+ host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs)) |
1356 |
+ host-cshlib := $(addprefix $(obj)/,$(host-cshlib)) |
1357 |
++host-cxxshlib := $(addprefix $(obj)/,$(host-cxxshlib)) |
1358 |
+ host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) |
1359 |
++host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs)) |
1360 |
+ host-objdirs := $(addprefix $(obj)/,$(host-objdirs)) |
1361 |
+ |
1362 |
+ obj-dirs += $(host-objdirs) |
1363 |
+@@ -156,6 +164,13 @@ quiet_cmd_host-cshobjs = HOSTCC -fPIC $@ |
1364 |
+ $(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE |
1365 |
+ $(call if_changed_dep,host-cshobjs) |
1366 |
+ |
1367 |
++# Compile .c file, create position independent .o file |
1368 |
++# host-cxxshobjs -> .o |
1369 |
++quiet_cmd_host-cxxshobjs = HOSTCXX -fPIC $@ |
1370 |
++ cmd_host-cxxshobjs = $(HOSTCXX) $(hostcxx_flags) -fPIC -c -o $@ $< |
1371 |
++$(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE |
1372 |
++ $(call if_changed_dep,host-cxxshobjs) |
1373 |
++ |
1374 |
+ # Link a shared library, based on position independent .o files |
1375 |
+ # *.o -> .so shared library (host-cshlib) |
1376 |
+ quiet_cmd_host-cshlib = HOSTLLD -shared $@ |
1377 |
+@@ -165,6 +180,15 @@ quiet_cmd_host-cshlib = HOSTLLD -shared $@ |
1378 |
+ $(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE |
1379 |
+ $(call if_changed,host-cshlib) |
1380 |
+ |
1381 |
++# Link a shared library, based on position independent .o files |
1382 |
++# *.o -> .so shared library (host-cxxshlib) |
1383 |
++quiet_cmd_host-cxxshlib = HOSTLLD -shared $@ |
1384 |
++ cmd_host-cxxshlib = $(HOSTCXX) $(HOSTLDFLAGS) -shared -o $@ \ |
1385 |
++ $(addprefix $(obj)/,$($(@F:.so=-objs))) \ |
1386 |
++ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) |
1387 |
++$(host-cxxshlib): $(obj)/%: $(host-cxxshobjs) FORCE |
1388 |
++ $(call if_changed,host-cxxshlib) |
1389 |
++ |
1390 |
+ targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ |
1391 |
+- $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) |
1392 |
++ $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) $(host-cxxshlib) $(host-cxxshobjs) |
1393 |
|
1394 |
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c |
1395 |
index cb1f50c..cef2a7c 100644 |
1396 |
@@ -79289,12 +79369,27 @@ index cb1f50c..cef2a7c 100644 |
1397 |
fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", |
1398 |
diff --git a/scripts/gcc-plugin.sh b/scripts/gcc-plugin.sh |
1399 |
new file mode 100644 |
1400 |
-index 0000000..8729101 |
1401 |
+index 0000000..5a412da |
1402 |
--- /dev/null |
1403 |
+++ b/scripts/gcc-plugin.sh |
1404 |
-@@ -0,0 +1,2 @@ |
1405 |
+@@ -0,0 +1,17 @@ |
1406 |
+#!/bin/sh |
1407 |
-+echo -e "#include \"gcc-plugin.h\"\n#include \"tree.h\"\n#include \"tm.h\"\n#include \"rtl.h\"" | $1 -x c -shared - -o /dev/null -I`$2 -print-file-name=plugin`/include >/dev/null 2>&1 && echo "y" |
1408 |
++plugincc=`$1 -x c -shared - -o /dev/null -I\`$3 -print-file-name=plugin\`/include 2>&1 <<EOF |
1409 |
++#include "gcc-plugin.h" |
1410 |
++#include "tree.h" |
1411 |
++#include "tm.h" |
1412 |
++#include "rtl.h" |
1413 |
++#ifdef ENABLE_BUILD_WITH_CXX |
1414 |
++#warning $2 |
1415 |
++#else |
1416 |
++#warning $1 |
1417 |
++#endif |
1418 |
++EOF` |
1419 |
++if [ $? -eq 0 ] |
1420 |
++then |
1421 |
++ [[ "$plugincc" =~ "$1" ]] && echo $1 |
1422 |
++ [[ "$plugincc" =~ "$2" ]] && echo $2 |
1423 |
++fi |
1424 |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c |
1425 |
index d1d0ae8..6b73b2a 100644 |
1426 |
--- a/scripts/mod/file2alias.c |
1427 |
@@ -81096,28 +81191,33 @@ index a39edcc..1014050 100644 |
1428 |
}; |
1429 |
diff --git a/tools/gcc/Makefile b/tools/gcc/Makefile |
1430 |
new file mode 100644 |
1431 |
-index 0000000..ca64170 |
1432 |
+index 0000000..991f33b |
1433 |
--- /dev/null |
1434 |
+++ b/tools/gcc/Makefile |
1435 |
-@@ -0,0 +1,26 @@ |
1436 |
+@@ -0,0 +1,31 @@ |
1437 |
+#CC := gcc |
1438 |
+#PLUGIN_SOURCE_FILES := pax_plugin.c |
1439 |
+#PLUGIN_OBJECT_FILES := $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES)) |
1440 |
+GCCPLUGINS_DIR := $(shell $(CC) -print-file-name=plugin) |
1441 |
+#CFLAGS += -I$(GCCPLUGINS_DIR)/include -fPIC -O2 -Wall -W -std=gnu99 |
1442 |
+ |
1443 |
++ifeq ($(PLUGINCC),$(HOSTCC)) |
1444 |
++HOSTLIBS := hostlibs |
1445 |
+HOST_EXTRACFLAGS += -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family -std=gnu99 -ggdb |
1446 |
-+CFLAGS_size_overflow_plugin.o := -Wno-missing-initializer |
1447 |
++else |
1448 |
++HOSTLIBS := hostcxxlibs |
1449 |
++HOST_EXTRACXXFLAGS += -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family -std=gnu++98 -ggdb -Wno-unused-parameter |
1450 |
++endif |
1451 |
+ |
1452 |
-+hostlibs-y := constify_plugin.so |
1453 |
-+hostlibs-$(CONFIG_PAX_MEMORY_STACKLEAK) += stackleak_plugin.so |
1454 |
-+hostlibs-$(CONFIG_KALLOCSTAT_PLUGIN) += kallocstat_plugin.so |
1455 |
-+hostlibs-$(CONFIG_PAX_KERNEXEC_PLUGIN) += kernexec_plugin.so |
1456 |
-+hostlibs-$(CONFIG_CHECKER_PLUGIN) += checker_plugin.so |
1457 |
-+hostlibs-y += colorize_plugin.so |
1458 |
-+hostlibs-$(CONFIG_PAX_SIZE_OVERFLOW) += size_overflow_plugin.so |
1459 |
++$(HOSTLIBS)-y := constify_plugin.so |
1460 |
++$(HOSTLIBS)-$(CONFIG_PAX_MEMORY_STACKLEAK) += stackleak_plugin.so |
1461 |
++$(HOSTLIBS)-$(CONFIG_KALLOCSTAT_PLUGIN) += kallocstat_plugin.so |
1462 |
++$(HOSTLIBS)-$(CONFIG_PAX_KERNEXEC_PLUGIN) += kernexec_plugin.so |
1463 |
++$(HOSTLIBS)-$(CONFIG_CHECKER_PLUGIN) += checker_plugin.so |
1464 |
++$(HOSTLIBS)-y += colorize_plugin.so |
1465 |
++$(HOSTLIBS)-$(CONFIG_PAX_SIZE_OVERFLOW) += size_overflow_plugin.so |
1466 |
+ |
1467 |
-+always := $(hostlibs-y) |
1468 |
++always := $($(HOSTLIBS)-y) |
1469 |
+ |
1470 |
+constify_plugin-objs := constify_plugin.o |
1471 |
+stackleak_plugin-objs := stackleak_plugin.o |
1472 |
@@ -81305,10 +81405,10 @@ index 0000000..d41b5af |
1473 |
+} |
1474 |
diff --git a/tools/gcc/colorize_plugin.c b/tools/gcc/colorize_plugin.c |
1475 |
new file mode 100644 |
1476 |
-index 0000000..ee950d0 |
1477 |
+index 0000000..7a5e311 |
1478 |
--- /dev/null |
1479 |
+++ b/tools/gcc/colorize_plugin.c |
1480 |
-@@ -0,0 +1,147 @@ |
1481 |
+@@ -0,0 +1,148 @@ |
1482 |
+/* |
1483 |
+ * Copyright 2012 by PaX Team <pageexec@××××××××.hu> |
1484 |
+ * Licensed under the GPL v2 |
1485 |
@@ -81340,6 +81440,7 @@ index 0000000..ee950d0 |
1486 |
+ |
1487 |
+static struct plugin_info colorize_plugin_info = { |
1488 |
+ .version = "201203092200", |
1489 |
++ .help = NULL, |
1490 |
+}; |
1491 |
+ |
1492 |
+#define GREEN "\033[32m\033[2m" |
1493 |
@@ -99089,10 +99190,10 @@ index 0000000..cd8690a |
1494 |
+}; |
1495 |
diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c |
1496 |
new file mode 100644 |
1497 |
-index 0000000..9ad0f39 |
1498 |
+index 0000000..273e66a |
1499 |
--- /dev/null |
1500 |
+++ b/tools/gcc/size_overflow_plugin.c |
1501 |
-@@ -0,0 +1,1221 @@ |
1502 |
+@@ -0,0 +1,1203 @@ |
1503 |
+/* |
1504 |
+ * Copyright 2011, 2012 by Emese Revfy <re.emese@×××××.com> |
1505 |
+ * Licensed under the GPL v2, or (at your option) v3 |
1506 |
@@ -99105,7 +99206,7 @@ index 0000000..9ad0f39 |
1507 |
+ * The recomputed argument is checked against TYPE_MAX and an event is logged on overflow and the triggering process is killed. |
1508 |
+ * |
1509 |
+ * Usage: |
1510 |
-+ * $ gcc -I`gcc -print-file-name=plugin`/include -fPIC -shared -O2 -o size_overflow_plugin.so size_overflow_plugin.c |
1511 |
++ * $ gcc -I`gcc -print-file-name=plugin`/include/c-family -I`gcc -print-file-name=plugin`/include -fPIC -shared -O2 -ggdb -Wall -W -Wno-missing-field-initializers -o size_overflow_plugin.so size_overflow_plugin.c |
1512 |
+ * $ gcc -fplugin=size_overflow_plugin.so test.c -O2 |
1513 |
+ */ |
1514 |
+ |
1515 |
@@ -99159,8 +99260,8 @@ index 0000000..9ad0f39 |
1516 |
+static unsigned int handle_function(void); |
1517 |
+ |
1518 |
+static struct plugin_info size_overflow_plugin_info = { |
1519 |
-+ .version = "20120612beta", |
1520 |
-+ .help = "no-size_overflow\tturn off size overflow checking\n", |
1521 |
++ .version = "20120617beta", |
1522 |
++ .help = "no-size-overflow\tturn off size overflow checking\n", |
1523 |
+}; |
1524 |
+ |
1525 |
+static tree handle_size_overflow_attribute(tree *node, tree __unused name, tree args, int __unused flags, bool *no_add_attrs) |
1526 |
@@ -99185,6 +99286,9 @@ index 0000000..9ad0f39 |
1527 |
+ .type_required = true, |
1528 |
+ .function_type_required = true, |
1529 |
+ .handler = handle_size_overflow_attribute |
1530 |
++#if BUILDING_GCC_VERSION >= 4007 |
1531 |
++ .affects_type_identity = false |
1532 |
++#endif |
1533 |
+}; |
1534 |
+ |
1535 |
+static void register_attributes(void __unused *event_data, void __unused *data) |
1536 |
@@ -99445,11 +99549,17 @@ index 0000000..9ad0f39 |
1537 |
+ |
1538 |
+static tree cast_a_tree(tree type, tree var) |
1539 |
+{ |
1540 |
++ gcc_assert(type != NULL_TREE && var != NULL_TREE); |
1541 |
+ gcc_assert(fold_convertible_p(type, var)); |
1542 |
+ |
1543 |
+ return fold_convert(type, var); |
1544 |
+} |
1545 |
+ |
1546 |
++static tree signed_cast(tree var) |
1547 |
++{ |
1548 |
++ return cast_a_tree(signed_size_overflow_type, var); |
1549 |
++} |
1550 |
++ |
1551 |
+static gimple build_cast_stmt(tree type, tree var, tree new_var, location_t loc) |
1552 |
+{ |
1553 |
+ gimple assign; |
1554 |
@@ -99548,7 +99658,7 @@ index 0000000..9ad0f39 |
1555 |
+ |
1556 |
+ if (rhs1 != NULL_TREE) { |
1557 |
+ if (!gimple_assign_cast_p(oldstmt)) |
1558 |
-+ rhs1 = cast_a_tree(signed_size_overflow_type, rhs1); |
1559 |
++ rhs1 = signed_cast(rhs1); |
1560 |
+ gimple_assign_set_rhs1(stmt, rhs1); |
1561 |
+ } |
1562 |
+ |
1563 |
@@ -99586,13 +99696,6 @@ index 0000000..9ad0f39 |
1564 |
+ return phi; |
1565 |
+} |
1566 |
+ |
1567 |
-+static tree signed_cast_constant(tree node) |
1568 |
-+{ |
1569 |
-+ gcc_assert(is_gimple_constant(node)); |
1570 |
-+ |
1571 |
-+ return cast_a_tree(signed_size_overflow_type, node); |
1572 |
-+} |
1573 |
-+ |
1574 |
+static basic_block create_a_first_bb(void) |
1575 |
+{ |
1576 |
+ basic_block first_bb; |
1577 |
@@ -99688,7 +99791,7 @@ index 0000000..9ad0f39 |
1578 |
+ |
1579 |
+ arg = gimple_phi_arg_def(oldstmt, i); |
1580 |
+ if (is_gimple_constant(arg)) |
1581 |
-+ arg = signed_cast_constant(arg); |
1582 |
++ arg = signed_cast(arg); |
1583 |
+ lhs = build_new_phi_arg(visited, potentionally_overflowed, arg, new_var); |
1584 |
+ if (lhs == NULL_TREE) |
1585 |
+ lhs = gimple_get_lhs(cast_old_phi_arg(oldstmt, arg, new_var, i)); |
1586 |
@@ -99721,7 +99824,7 @@ index 0000000..9ad0f39 |
1587 |
+ tree rhs1 = gimple_assign_rhs1(def_stmt); |
1588 |
+ |
1589 |
+ if (is_gimple_constant(rhs1)) |
1590 |
-+ return dup_assign(visited, potentionally_overflowed, def_stmt, signed_cast_constant(rhs1), NULL_TREE, NULL_TREE); |
1591 |
++ return dup_assign(visited, potentionally_overflowed, def_stmt, signed_cast(rhs1), NULL_TREE, NULL_TREE); |
1592 |
+ |
1593 |
+ gcc_assert(TREE_CODE(rhs1) != COND_EXPR); |
1594 |
+ switch (TREE_CODE(rhs1)) { |
1595 |
@@ -99850,19 +99953,6 @@ index 0000000..9ad0f39 |
1596 |
+// print_the_code_insertions(stmt); |
1597 |
+} |
1598 |
+ |
1599 |
-+static tree get_type_for_check(tree rhs) |
1600 |
-+{ |
1601 |
-+ tree def_rhs; |
1602 |
-+ gimple def_stmt = get_def_stmt(rhs); |
1603 |
-+ |
1604 |
-+ if (!gimple_assign_cast_p(def_stmt)) |
1605 |
-+ return TREE_TYPE(rhs); |
1606 |
-+ def_rhs = gimple_assign_rhs1(def_stmt); |
1607 |
-+ if (TREE_CODE(TREE_TYPE(def_rhs)) == INTEGER_TYPE) |
1608 |
-+ return TREE_TYPE(def_rhs); |
1609 |
-+ return TREE_TYPE(rhs); |
1610 |
-+} |
1611 |
-+ |
1612 |
+static gimple cast_to_unsigned_size_overflow_type(gimple stmt, tree cast_rhs) |
1613 |
+{ |
1614 |
+ gimple ucast_stmt; |
1615 |
@@ -99877,61 +99967,54 @@ index 0000000..9ad0f39 |
1616 |
+ |
1617 |
+static void check_size_overflow(gimple stmt, tree cast_rhs, tree rhs, bool *potentionally_overflowed) |
1618 |
+{ |
1619 |
-+ tree type_max, type_min, rhs_type; |
1620 |
++ tree type_max, type_min, rhs_type = TREE_TYPE(rhs); |
1621 |
+ gimple ucast_stmt; |
1622 |
+ |
1623 |
+ if (!*potentionally_overflowed) |
1624 |
+ return; |
1625 |
+ |
1626 |
-+ rhs_type = get_type_for_check(rhs); |
1627 |
-+ |
1628 |
+ if (TYPE_UNSIGNED(rhs_type)) { |
1629 |
+ ucast_stmt = cast_to_unsigned_size_overflow_type(stmt, cast_rhs); |
1630 |
+ type_max = cast_a_tree(unsigned_size_overflow_type, TYPE_MAX_VALUE(rhs_type)); |
1631 |
+ insert_check_size_overflow(stmt, GT_EXPR, gimple_get_lhs(ucast_stmt), type_max); |
1632 |
+ } else { |
1633 |
-+ type_max = cast_a_tree(signed_size_overflow_type, TYPE_MAX_VALUE(rhs_type)); |
1634 |
++ type_max = signed_cast(TYPE_MAX_VALUE(rhs_type)); |
1635 |
+ insert_check_size_overflow(stmt, GT_EXPR, cast_rhs, type_max); |
1636 |
+ |
1637 |
-+ type_min = cast_a_tree(signed_size_overflow_type, TYPE_MIN_VALUE(rhs_type)); |
1638 |
++ type_min = signed_cast(TYPE_MIN_VALUE(rhs_type)); |
1639 |
+ insert_check_size_overflow(stmt, LT_EXPR, cast_rhs, type_min); |
1640 |
+ } |
1641 |
+} |
1642 |
+ |
1643 |
-+static tree change_assign_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple stmt, tree orig_rhs) |
1644 |
++static tree change_assign_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple stmt, tree orig_rhs, tree new_rhs) |
1645 |
+{ |
1646 |
+ gimple assign; |
1647 |
+ gimple_stmt_iterator gsi = gsi_for_stmt(stmt); |
1648 |
-+ tree new_rhs, origtype = TREE_TYPE(orig_rhs); |
1649 |
++ tree origtype = TREE_TYPE(orig_rhs); |
1650 |
+ |
1651 |
+ gcc_assert(gimple_code(stmt) == GIMPLE_ASSIGN); |
1652 |
+ |
1653 |
-+ new_rhs = expand(visited, potentionally_overflowed, orig_rhs); |
1654 |
-+ if (new_rhs == NULL_TREE) |
1655 |
-+ return NULL_TREE; |
1656 |
-+ |
1657 |
+ assign = build_cast_stmt(origtype, new_rhs, CREATE_NEW_VAR, gimple_location(stmt)); |
1658 |
+ gsi_insert_before(&gsi, assign, GSI_SAME_STMT); |
1659 |
+ update_stmt(assign); |
1660 |
+ return gimple_get_lhs(assign); |
1661 |
+} |
1662 |
+ |
1663 |
-+static tree handle_const_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple def_stmt, tree var, tree rhs, tree new_rhs1, tree new_rhs2, void (*gimple_assign_set_rhs)(gimple, tree)) |
1664 |
++static tree handle_const_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple def_stmt, tree var, tree orig_rhs, tree var_rhs, tree new_rhs1, tree new_rhs2, void (*gimple_assign_set_rhs)(gimple, tree)) |
1665 |
+{ |
1666 |
-+ tree new_rhs, cast_rhs; |
1667 |
++ tree new_rhs; |
1668 |
+ |
1669 |
+ if (gimple_assign_rhs_code(def_stmt) == MIN_EXPR) |
1670 |
+ return dup_assign(visited, potentionally_overflowed, def_stmt, new_rhs1, new_rhs2, NULL_TREE); |
1671 |
+ |
1672 |
-+ new_rhs = change_assign_rhs(visited, potentionally_overflowed, def_stmt, rhs); |
1673 |
-+ if (new_rhs != NULL_TREE) { |
1674 |
-+ gimple_assign_set_rhs(def_stmt, new_rhs); |
1675 |
-+ update_stmt(def_stmt); |
1676 |
++ if (var_rhs == NULL_TREE) |
1677 |
++ return create_assign(visited, potentionally_overflowed, def_stmt, var, AFTER_STMT); |
1678 |
+ |
1679 |
-+ cast_rhs = gimple_assign_rhs1(get_def_stmt(new_rhs)); |
1680 |
++ new_rhs = change_assign_rhs(visited, potentionally_overflowed, def_stmt, orig_rhs, var_rhs); |
1681 |
++ gimple_assign_set_rhs(def_stmt, new_rhs); |
1682 |
++ update_stmt(def_stmt); |
1683 |
+ |
1684 |
-+ check_size_overflow(def_stmt, cast_rhs, rhs, potentionally_overflowed); |
1685 |
-+ } |
1686 |
++ check_size_overflow(def_stmt, var_rhs, orig_rhs, potentionally_overflowed); |
1687 |
+ return create_assign(visited, potentionally_overflowed, def_stmt, var, AFTER_STMT); |
1688 |
+} |
1689 |
+ |
1690 |
@@ -99972,10 +100055,10 @@ index 0000000..9ad0f39 |
1691 |
+ new_rhs2 = expand(visited, potentionally_overflowed, rhs2); |
1692 |
+ |
1693 |
+ if (is_gimple_constant(rhs2)) |
1694 |
-+ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs1, new_rhs1, signed_cast_constant(rhs2), &gimple_assign_set_rhs1); |
1695 |
++ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs1, new_rhs1, new_rhs1, signed_cast(rhs2), &gimple_assign_set_rhs1); |
1696 |
+ |
1697 |
+ if (is_gimple_constant(rhs1)) |
1698 |
-+ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs2, signed_cast_constant(rhs1), new_rhs2, &gimple_assign_set_rhs2); |
1699 |
++ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs2, new_rhs2, signed_cast(rhs1), new_rhs2, &gimple_assign_set_rhs2); |
1700 |
+ |
1701 |
+ return dup_assign(visited, potentionally_overflowed, def_stmt, new_rhs1, new_rhs2, NULL_TREE); |
1702 |
+} |
1703 |
@@ -99984,7 +100067,7 @@ index 0000000..9ad0f39 |
1704 |
+static tree get_new_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, tree rhs) |
1705 |
+{ |
1706 |
+ if (is_gimple_constant(rhs)) |
1707 |
-+ return signed_cast_constant(rhs); |
1708 |
++ return signed_cast(rhs); |
1709 |
+ if (TREE_CODE(rhs) != SSA_NAME) |
1710 |
+ return NULL_TREE; |
1711 |
+ return expand(visited, potentionally_overflowed, rhs); |
1712 |
|
1713 |
diff --git a/3.4.2/0000_README b/3.4.3/0000_README |
1714 |
similarity index 93% |
1715 |
rename from 3.4.2/0000_README |
1716 |
rename to 3.4.3/0000_README |
1717 |
index e8b7a86..510fb5d 100644 |
1718 |
--- a/3.4.2/0000_README |
1719 |
+++ b/3.4.3/0000_README |
1720 |
@@ -2,7 +2,11 @@ README |
1721 |
----------------------------------------------------------------------------- |
1722 |
Individual Patch Descriptions: |
1723 |
----------------------------------------------------------------------------- |
1724 |
-Patch: 4420_grsecurity-2.9.1-3.4.2-201206160836.patch |
1725 |
+Patch: 1002_linux-3.4.3.patch |
1726 |
+From: http://www.kernel.org |
1727 |
+Desc: Linux 3.4.3 |
1728 |
+ |
1729 |
+Patch: 4420_grsecurity-2.9.1-3.4.3-201206171836.patch |
1730 |
From: http://www.grsecurity.net |
1731 |
Desc: hardened-sources base patch from upstream grsecurity |
1732 |
|
1733 |
|
1734 |
diff --git a/3.4.3/1002_linux-3.4.3.patch b/3.4.3/1002_linux-3.4.3.patch |
1735 |
new file mode 100644 |
1736 |
index 0000000..2c6ffa6 |
1737 |
--- /dev/null |
1738 |
+++ b/3.4.3/1002_linux-3.4.3.patch |
1739 |
@@ -0,0 +1,1622 @@ |
1740 |
+diff --git a/Makefile b/Makefile |
1741 |
+index 901a955..a0804c6 100644 |
1742 |
+--- a/Makefile |
1743 |
++++ b/Makefile |
1744 |
+@@ -1,6 +1,6 @@ |
1745 |
+ VERSION = 3 |
1746 |
+ PATCHLEVEL = 4 |
1747 |
+-SUBLEVEL = 2 |
1748 |
++SUBLEVEL = 3 |
1749 |
+ EXTRAVERSION = |
1750 |
+ NAME = Saber-toothed Squirrel |
1751 |
+ |
1752 |
+diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c |
1753 |
+index 0b6d796..2e3200c 100644 |
1754 |
+--- a/arch/powerpc/kernel/module_32.c |
1755 |
++++ b/arch/powerpc/kernel/module_32.c |
1756 |
+@@ -176,8 +176,8 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr, |
1757 |
+ |
1758 |
+ static inline int entry_matches(struct ppc_plt_entry *entry, Elf32_Addr val) |
1759 |
+ { |
1760 |
+- if (entry->jump[0] == 0x3d600000 + ((val + 0x8000) >> 16) |
1761 |
+- && entry->jump[1] == 0x396b0000 + (val & 0xffff)) |
1762 |
++ if (entry->jump[0] == 0x3d800000 + ((val + 0x8000) >> 16) |
1763 |
++ && entry->jump[1] == 0x398c0000 + (val & 0xffff)) |
1764 |
+ return 1; |
1765 |
+ return 0; |
1766 |
+ } |
1767 |
+@@ -204,10 +204,9 @@ static uint32_t do_plt_call(void *location, |
1768 |
+ entry++; |
1769 |
+ } |
1770 |
+ |
1771 |
+- /* Stolen from Paul Mackerras as well... */ |
1772 |
+- entry->jump[0] = 0x3d600000+((val+0x8000)>>16); /* lis r11,sym@ha */ |
1773 |
+- entry->jump[1] = 0x396b0000 + (val&0xffff); /* addi r11,r11,sym@l*/ |
1774 |
+- entry->jump[2] = 0x7d6903a6; /* mtctr r11 */ |
1775 |
++ entry->jump[0] = 0x3d800000+((val+0x8000)>>16); /* lis r12,sym@ha */ |
1776 |
++ entry->jump[1] = 0x398c0000 + (val&0xffff); /* addi r12,r12,sym@l*/ |
1777 |
++ entry->jump[2] = 0x7d8903a6; /* mtctr r12 */ |
1778 |
+ entry->jump[3] = 0x4e800420; /* bctr */ |
1779 |
+ |
1780 |
+ DEBUGP("Initialized plt for 0x%x at %p\n", val, entry); |
1781 |
+diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c |
1782 |
+index 2c42cd7..730e69c 100644 |
1783 |
+--- a/arch/powerpc/kernel/time.c |
1784 |
++++ b/arch/powerpc/kernel/time.c |
1785 |
+@@ -474,6 +474,7 @@ void timer_interrupt(struct pt_regs * regs) |
1786 |
+ struct pt_regs *old_regs; |
1787 |
+ u64 *next_tb = &__get_cpu_var(decrementers_next_tb); |
1788 |
+ struct clock_event_device *evt = &__get_cpu_var(decrementers); |
1789 |
++ u64 now; |
1790 |
+ |
1791 |
+ /* Ensure a positive value is written to the decrementer, or else |
1792 |
+ * some CPUs will continue to take decrementer exceptions. |
1793 |
+@@ -508,9 +509,16 @@ void timer_interrupt(struct pt_regs * regs) |
1794 |
+ irq_work_run(); |
1795 |
+ } |
1796 |
+ |
1797 |
+- *next_tb = ~(u64)0; |
1798 |
+- if (evt->event_handler) |
1799 |
+- evt->event_handler(evt); |
1800 |
++ now = get_tb_or_rtc(); |
1801 |
++ if (now >= *next_tb) { |
1802 |
++ *next_tb = ~(u64)0; |
1803 |
++ if (evt->event_handler) |
1804 |
++ evt->event_handler(evt); |
1805 |
++ } else { |
1806 |
++ now = *next_tb - now; |
1807 |
++ if (now <= DECREMENTER_MAX) |
1808 |
++ set_dec((int)now); |
1809 |
++ } |
1810 |
+ |
1811 |
+ #ifdef CONFIG_PPC64 |
1812 |
+ /* collect purr register values often, for accurate calculations */ |
1813 |
+diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S |
1814 |
+index be6d9e3..3470624 100644 |
1815 |
+--- a/arch/x86/crypto/aesni-intel_asm.S |
1816 |
++++ b/arch/x86/crypto/aesni-intel_asm.S |
1817 |
+@@ -2460,10 +2460,12 @@ ENTRY(aesni_cbc_dec) |
1818 |
+ pxor IN3, STATE4 |
1819 |
+ movaps IN4, IV |
1820 |
+ #else |
1821 |
+- pxor (INP), STATE2 |
1822 |
+- pxor 0x10(INP), STATE3 |
1823 |
+ pxor IN1, STATE4 |
1824 |
+ movaps IN2, IV |
1825 |
++ movups (INP), IN1 |
1826 |
++ pxor IN1, STATE2 |
1827 |
++ movups 0x10(INP), IN2 |
1828 |
++ pxor IN2, STATE3 |
1829 |
+ #endif |
1830 |
+ movups STATE1, (OUTP) |
1831 |
+ movups STATE2, 0x10(OUTP) |
1832 |
+diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h |
1833 |
+index becf47b..6149b47 100644 |
1834 |
+--- a/arch/x86/include/asm/uv/uv_bau.h |
1835 |
++++ b/arch/x86/include/asm/uv/uv_bau.h |
1836 |
+@@ -149,7 +149,6 @@ |
1837 |
+ /* 4 bits of software ack period */ |
1838 |
+ #define UV2_ACK_MASK 0x7UL |
1839 |
+ #define UV2_ACK_UNITS_SHFT 3 |
1840 |
+-#define UV2_LEG_SHFT UV2H_LB_BAU_MISC_CONTROL_USE_LEGACY_DESCRIPTOR_FORMATS_SHFT |
1841 |
+ #define UV2_EXT_SHFT UV2H_LB_BAU_MISC_CONTROL_ENABLE_EXTENDED_SB_STATUS_SHFT |
1842 |
+ |
1843 |
+ /* |
1844 |
+diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c |
1845 |
+index 99b5717..2c1d178 100644 |
1846 |
+--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c |
1847 |
++++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c |
1848 |
+@@ -51,6 +51,7 @@ struct threshold_block { |
1849 |
+ unsigned int cpu; |
1850 |
+ u32 address; |
1851 |
+ u16 interrupt_enable; |
1852 |
++ bool interrupt_capable; |
1853 |
+ u16 threshold_limit; |
1854 |
+ struct kobject kobj; |
1855 |
+ struct list_head miscj; |
1856 |
+@@ -83,6 +84,21 @@ struct thresh_restart { |
1857 |
+ u16 old_limit; |
1858 |
+ }; |
1859 |
+ |
1860 |
++static bool lvt_interrupt_supported(unsigned int bank, u32 msr_high_bits) |
1861 |
++{ |
1862 |
++ /* |
1863 |
++ * bank 4 supports APIC LVT interrupts implicitly since forever. |
1864 |
++ */ |
1865 |
++ if (bank == 4) |
1866 |
++ return true; |
1867 |
++ |
1868 |
++ /* |
1869 |
++ * IntP: interrupt present; if this bit is set, the thresholding |
1870 |
++ * bank can generate APIC LVT interrupts |
1871 |
++ */ |
1872 |
++ return msr_high_bits & BIT(28); |
1873 |
++} |
1874 |
++ |
1875 |
+ static int lvt_off_valid(struct threshold_block *b, int apic, u32 lo, u32 hi) |
1876 |
+ { |
1877 |
+ int msr = (hi & MASK_LVTOFF_HI) >> 20; |
1878 |
+@@ -104,8 +120,10 @@ static int lvt_off_valid(struct threshold_block *b, int apic, u32 lo, u32 hi) |
1879 |
+ return 1; |
1880 |
+ }; |
1881 |
+ |
1882 |
+-/* must be called with correct cpu affinity */ |
1883 |
+-/* Called via smp_call_function_single() */ |
1884 |
++/* |
1885 |
++ * Called via smp_call_function_single(), must be called with correct |
1886 |
++ * cpu affinity. |
1887 |
++ */ |
1888 |
+ static void threshold_restart_bank(void *_tr) |
1889 |
+ { |
1890 |
+ struct thresh_restart *tr = _tr; |
1891 |
+@@ -128,6 +146,12 @@ static void threshold_restart_bank(void *_tr) |
1892 |
+ (new_count & THRESHOLD_MAX); |
1893 |
+ } |
1894 |
+ |
1895 |
++ /* clear IntType */ |
1896 |
++ hi &= ~MASK_INT_TYPE_HI; |
1897 |
++ |
1898 |
++ if (!tr->b->interrupt_capable) |
1899 |
++ goto done; |
1900 |
++ |
1901 |
+ if (tr->set_lvt_off) { |
1902 |
+ if (lvt_off_valid(tr->b, tr->lvt_off, lo, hi)) { |
1903 |
+ /* set new lvt offset */ |
1904 |
+@@ -136,9 +160,10 @@ static void threshold_restart_bank(void *_tr) |
1905 |
+ } |
1906 |
+ } |
1907 |
+ |
1908 |
+- tr->b->interrupt_enable ? |
1909 |
+- (hi = (hi & ~MASK_INT_TYPE_HI) | INT_TYPE_APIC) : |
1910 |
+- (hi &= ~MASK_INT_TYPE_HI); |
1911 |
++ if (tr->b->interrupt_enable) |
1912 |
++ hi |= INT_TYPE_APIC; |
1913 |
++ |
1914 |
++ done: |
1915 |
+ |
1916 |
+ hi |= MASK_COUNT_EN_HI; |
1917 |
+ wrmsr(tr->b->address, lo, hi); |
1918 |
+@@ -202,14 +227,17 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c) |
1919 |
+ if (shared_bank[bank] && c->cpu_core_id) |
1920 |
+ break; |
1921 |
+ |
1922 |
+- offset = setup_APIC_mce(offset, |
1923 |
+- (high & MASK_LVTOFF_HI) >> 20); |
1924 |
+- |
1925 |
+ memset(&b, 0, sizeof(b)); |
1926 |
+- b.cpu = cpu; |
1927 |
+- b.bank = bank; |
1928 |
+- b.block = block; |
1929 |
+- b.address = address; |
1930 |
++ b.cpu = cpu; |
1931 |
++ b.bank = bank; |
1932 |
++ b.block = block; |
1933 |
++ b.address = address; |
1934 |
++ b.interrupt_capable = lvt_interrupt_supported(bank, high); |
1935 |
++ |
1936 |
++ if (b.interrupt_capable) { |
1937 |
++ int new = (high & MASK_LVTOFF_HI) >> 20; |
1938 |
++ offset = setup_APIC_mce(offset, new); |
1939 |
++ } |
1940 |
+ |
1941 |
+ mce_threshold_block_init(&b, offset); |
1942 |
+ mce_threshold_vector = amd_threshold_interrupt; |
1943 |
+@@ -309,6 +337,9 @@ store_interrupt_enable(struct threshold_block *b, const char *buf, size_t size) |
1944 |
+ struct thresh_restart tr; |
1945 |
+ unsigned long new; |
1946 |
+ |
1947 |
++ if (!b->interrupt_capable) |
1948 |
++ return -EINVAL; |
1949 |
++ |
1950 |
+ if (strict_strtoul(buf, 0, &new) < 0) |
1951 |
+ return -EINVAL; |
1952 |
+ |
1953 |
+@@ -467,6 +498,7 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, |
1954 |
+ b->cpu = cpu; |
1955 |
+ b->address = address; |
1956 |
+ b->interrupt_enable = 0; |
1957 |
++ b->interrupt_capable = lvt_interrupt_supported(bank, high); |
1958 |
+ b->threshold_limit = THRESHOLD_MAX; |
1959 |
+ |
1960 |
+ INIT_LIST_HEAD(&b->miscj); |
1961 |
+diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c |
1962 |
+index 3ae0e61..59880af 100644 |
1963 |
+--- a/arch/x86/platform/uv/tlb_uv.c |
1964 |
++++ b/arch/x86/platform/uv/tlb_uv.c |
1965 |
+@@ -1295,7 +1295,6 @@ static void __init enable_timeouts(void) |
1966 |
+ */ |
1967 |
+ mmr_image |= (1L << SOFTACK_MSHIFT); |
1968 |
+ if (is_uv2_hub()) { |
1969 |
+- mmr_image &= ~(1L << UV2_LEG_SHFT); |
1970 |
+ mmr_image |= (1L << UV2_EXT_SHFT); |
1971 |
+ } |
1972 |
+ write_mmr_misc_control(pnode, mmr_image); |
1973 |
+diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c |
1974 |
+index 9577b6f..66e8f73 100644 |
1975 |
+--- a/drivers/acpi/video.c |
1976 |
++++ b/drivers/acpi/video.c |
1977 |
+@@ -1745,6 +1745,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) |
1978 |
+ |
1979 |
+ static int __init intel_opregion_present(void) |
1980 |
+ { |
1981 |
++ int i915 = 0; |
1982 |
+ #if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE) |
1983 |
+ struct pci_dev *dev = NULL; |
1984 |
+ u32 address; |
1985 |
+@@ -1757,10 +1758,10 @@ static int __init intel_opregion_present(void) |
1986 |
+ pci_read_config_dword(dev, 0xfc, &address); |
1987 |
+ if (!address) |
1988 |
+ continue; |
1989 |
+- return 1; |
1990 |
++ i915 = 1; |
1991 |
+ } |
1992 |
+ #endif |
1993 |
+- return 0; |
1994 |
++ return i915; |
1995 |
+ } |
1996 |
+ |
1997 |
+ int acpi_video_register(void) |
1998 |
+diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c |
1999 |
+index 7857e8f..3c809bf 100644 |
2000 |
+--- a/drivers/ata/ata_piix.c |
2001 |
++++ b/drivers/ata/ata_piix.c |
2002 |
+@@ -1554,6 +1554,39 @@ static bool piix_broken_system_poweroff(struct pci_dev *pdev) |
2003 |
+ return false; |
2004 |
+ } |
2005 |
+ |
2006 |
++static int prefer_ms_hyperv = 1; |
2007 |
++module_param(prefer_ms_hyperv, int, 0); |
2008 |
++ |
2009 |
++static void piix_ignore_devices_quirk(struct ata_host *host) |
2010 |
++{ |
2011 |
++#if IS_ENABLED(CONFIG_HYPERV_STORAGE) |
2012 |
++ static const struct dmi_system_id ignore_hyperv[] = { |
2013 |
++ { |
2014 |
++ /* On Hyper-V hypervisors the disks are exposed on |
2015 |
++ * both the emulated SATA controller and on the |
2016 |
++ * paravirtualised drivers. The CD/DVD devices |
2017 |
++ * are only exposed on the emulated controller. |
2018 |
++ * Request we ignore ATA devices on this host. |
2019 |
++ */ |
2020 |
++ .ident = "Hyper-V Virtual Machine", |
2021 |
++ .matches = { |
2022 |
++ DMI_MATCH(DMI_SYS_VENDOR, |
2023 |
++ "Microsoft Corporation"), |
2024 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"), |
2025 |
++ }, |
2026 |
++ }, |
2027 |
++ { } /* terminate list */ |
2028 |
++ }; |
2029 |
++ const struct dmi_system_id *dmi = dmi_first_match(ignore_hyperv); |
2030 |
++ |
2031 |
++ if (dmi && prefer_ms_hyperv) { |
2032 |
++ host->flags |= ATA_HOST_IGNORE_ATA; |
2033 |
++ dev_info(host->dev, "%s detected, ATA device ignore set\n", |
2034 |
++ dmi->ident); |
2035 |
++ } |
2036 |
++#endif |
2037 |
++} |
2038 |
++ |
2039 |
+ /** |
2040 |
+ * piix_init_one - Register PIIX ATA PCI device with kernel services |
2041 |
+ * @pdev: PCI device to register |
2042 |
+@@ -1669,6 +1702,9 @@ static int __devinit piix_init_one(struct pci_dev *pdev, |
2043 |
+ } |
2044 |
+ host->flags |= ATA_HOST_PARALLEL_SCAN; |
2045 |
+ |
2046 |
++ /* Allow hosts to specify device types to ignore when scanning. */ |
2047 |
++ piix_ignore_devices_quirk(host); |
2048 |
++ |
2049 |
+ pci_set_master(pdev); |
2050 |
+ return ata_pci_sff_activate_host(host, ata_bmdma_interrupt, sht); |
2051 |
+ } |
2052 |
+diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c |
2053 |
+index 23763a1..d31ee55 100644 |
2054 |
+--- a/drivers/ata/libata-core.c |
2055 |
++++ b/drivers/ata/libata-core.c |
2056 |
+@@ -1973,6 +1973,12 @@ retry: |
2057 |
+ if (class == ATA_DEV_ATA) { |
2058 |
+ if (!ata_id_is_ata(id) && !ata_id_is_cfa(id)) |
2059 |
+ goto err_out; |
2060 |
++ if (ap->host->flags & ATA_HOST_IGNORE_ATA && |
2061 |
++ ata_id_is_ata(id)) { |
2062 |
++ ata_dev_dbg(dev, |
2063 |
++ "host indicates ignore ATA devices, ignored\n"); |
2064 |
++ return -ENOENT; |
2065 |
++ } |
2066 |
+ } else { |
2067 |
+ if (ata_id_is_ata(id)) |
2068 |
+ goto err_out; |
2069 |
+diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c |
2070 |
+index a058842..61ce405 100644 |
2071 |
+--- a/drivers/bcma/driver_chipcommon_pmu.c |
2072 |
++++ b/drivers/bcma/driver_chipcommon_pmu.c |
2073 |
+@@ -139,7 +139,9 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc) |
2074 |
+ bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7); |
2075 |
+ break; |
2076 |
+ case 0x4331: |
2077 |
+- /* BCM4331 workaround is SPROM-related, we put it in sprom.c */ |
2078 |
++ case 43431: |
2079 |
++ /* Ext PA lines must be enabled for tx on BCM4331 */ |
2080 |
++ bcma_chipco_bcm4331_ext_pa_lines_ctl(cc, true); |
2081 |
+ break; |
2082 |
+ case 43224: |
2083 |
+ if (bus->chipinfo.rev == 0) { |
2084 |
+diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c |
2085 |
+index 3e2a600..4588da2 100644 |
2086 |
+--- a/drivers/bcma/sprom.c |
2087 |
++++ b/drivers/bcma/sprom.c |
2088 |
+@@ -432,13 +432,13 @@ int bcma_sprom_get(struct bcma_bus *bus) |
2089 |
+ if (!sprom) |
2090 |
+ return -ENOMEM; |
2091 |
+ |
2092 |
+- if (bus->chipinfo.id == 0x4331) |
2093 |
++ if (bus->chipinfo.id == 0x4331 || bus->chipinfo.id == 43431) |
2094 |
+ bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false); |
2095 |
+ |
2096 |
+ pr_debug("SPROM offset 0x%x\n", offset); |
2097 |
+ bcma_sprom_read(bus, offset, sprom); |
2098 |
+ |
2099 |
+- if (bus->chipinfo.id == 0x4331) |
2100 |
++ if (bus->chipinfo.id == 0x4331 || bus->chipinfo.id == 43431) |
2101 |
+ bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true); |
2102 |
+ |
2103 |
+ err = bcma_sprom_valid(sprom); |
2104 |
+diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c |
2105 |
+index 962e75d..4293c48 100644 |
2106 |
+--- a/drivers/char/agp/intel-agp.c |
2107 |
++++ b/drivers/char/agp/intel-agp.c |
2108 |
+@@ -898,6 +898,7 @@ static struct pci_device_id agp_intel_pci_table[] = { |
2109 |
+ ID(PCI_DEVICE_ID_INTEL_B43_HB), |
2110 |
+ ID(PCI_DEVICE_ID_INTEL_B43_1_HB), |
2111 |
+ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB), |
2112 |
++ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_D2_HB), |
2113 |
+ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB), |
2114 |
+ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB), |
2115 |
+ ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB), |
2116 |
+diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h |
2117 |
+index 7ea18a5..439d7e7 100644 |
2118 |
+--- a/drivers/char/agp/intel-agp.h |
2119 |
++++ b/drivers/char/agp/intel-agp.h |
2120 |
+@@ -211,6 +211,7 @@ |
2121 |
+ #define PCI_DEVICE_ID_INTEL_G41_HB 0x2E30 |
2122 |
+ #define PCI_DEVICE_ID_INTEL_G41_IG 0x2E32 |
2123 |
+ #define PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB 0x0040 |
2124 |
++#define PCI_DEVICE_ID_INTEL_IRONLAKE_D2_HB 0x0069 |
2125 |
+ #define PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG 0x0042 |
2126 |
+ #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB 0x0044 |
2127 |
+ #define PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB 0x0062 |
2128 |
+diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c |
2129 |
+index f518b99..6289f0e 100644 |
2130 |
+--- a/drivers/char/hw_random/atmel-rng.c |
2131 |
++++ b/drivers/char/hw_random/atmel-rng.c |
2132 |
+@@ -36,6 +36,13 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max, |
2133 |
+ /* data ready? */ |
2134 |
+ if (readl(trng->base + TRNG_ODATA) & 1) { |
2135 |
+ *data = readl(trng->base + TRNG_ODATA); |
2136 |
++ /* |
2137 |
++ ensure data ready is only set again AFTER the next data |
2138 |
++ word is ready in case it got set between checking ISR |
2139 |
++ and reading ODATA, so we don't risk re-reading the |
2140 |
++ same word |
2141 |
++ */ |
2142 |
++ readl(trng->base + TRNG_ISR); |
2143 |
+ return 4; |
2144 |
+ } else |
2145 |
+ return 0; |
2146 |
+diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c |
2147 |
+index c34adf9..09af2ff 100644 |
2148 |
+--- a/drivers/gpu/drm/gma500/psb_drv.c |
2149 |
++++ b/drivers/gpu/drm/gma500/psb_drv.c |
2150 |
+@@ -349,7 +349,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) |
2151 |
+ PSB_WSGX32(0x30000000, PSB_CR_BIF_3D_REQ_BASE); |
2152 |
+ |
2153 |
+ /* igd_opregion_init(&dev_priv->opregion_dev); */ |
2154 |
+- acpi_video_register(); |
2155 |
++/* acpi_video_register(); */ |
2156 |
+ if (dev_priv->lid_state) |
2157 |
+ psb_lid_timer_init(dev_priv); |
2158 |
+ |
2159 |
+diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c |
2160 |
+index 62892a8..302d3d5 100644 |
2161 |
+--- a/drivers/gpu/drm/i915/intel_ringbuffer.c |
2162 |
++++ b/drivers/gpu/drm/i915/intel_ringbuffer.c |
2163 |
+@@ -309,6 +309,7 @@ static int init_ring_common(struct intel_ring_buffer *ring) |
2164 |
+ ring->head = I915_READ_HEAD(ring); |
2165 |
+ ring->tail = I915_READ_TAIL(ring) & TAIL_ADDR; |
2166 |
+ ring->space = ring_space(ring); |
2167 |
++ ring->last_retired_head = -1; |
2168 |
+ } |
2169 |
+ |
2170 |
+ return 0; |
2171 |
+@@ -1026,6 +1027,10 @@ int intel_init_ring_buffer(struct drm_device *dev, |
2172 |
+ if (ret) |
2173 |
+ goto err_unref; |
2174 |
+ |
2175 |
++ ret = i915_gem_object_set_to_gtt_domain(obj, true); |
2176 |
++ if (ret) |
2177 |
++ goto err_unpin; |
2178 |
++ |
2179 |
+ ring->map.size = ring->size; |
2180 |
+ ring->map.offset = dev->agp->base + obj->gtt_offset; |
2181 |
+ ring->map.type = 0; |
2182 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c |
2183 |
+index fa86035..7b11edb 100644 |
2184 |
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.c |
2185 |
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c |
2186 |
+@@ -654,7 +654,13 @@ nouveau_connector_detect_depth(struct drm_connector *connector) |
2187 |
+ if (nv_connector->edid && connector->display_info.bpc) |
2188 |
+ return; |
2189 |
+ |
2190 |
+- /* if not, we're out of options unless we're LVDS, default to 8bpc */ |
2191 |
++ /* EDID 1.4 is *supposed* to be supported on eDP, but, Apple... */ |
2192 |
++ if (nv_connector->type == DCB_CONNECTOR_eDP) { |
2193 |
++ connector->display_info.bpc = 6; |
2194 |
++ return; |
2195 |
++ } |
2196 |
++ |
2197 |
++ /* we're out of options unless we're LVDS, default to 8bpc */ |
2198 |
+ if (nv_encoder->dcb->type != OUTPUT_LVDS) { |
2199 |
+ connector->display_info.bpc = 8; |
2200 |
+ return; |
2201 |
+diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c |
2202 |
+index 70089d3..ea69dae 100644 |
2203 |
+--- a/drivers/gpu/drm/radeon/evergreen_cs.c |
2204 |
++++ b/drivers/gpu/drm/radeon/evergreen_cs.c |
2205 |
+@@ -52,6 +52,7 @@ struct evergreen_cs_track { |
2206 |
+ u32 cb_color_view[12]; |
2207 |
+ u32 cb_color_pitch[12]; |
2208 |
+ u32 cb_color_slice[12]; |
2209 |
++ u32 cb_color_slice_idx[12]; |
2210 |
+ u32 cb_color_attrib[12]; |
2211 |
+ u32 cb_color_cmask_slice[8];/* unused */ |
2212 |
+ u32 cb_color_fmask_slice[8];/* unused */ |
2213 |
+@@ -127,12 +128,14 @@ static void evergreen_cs_track_init(struct evergreen_cs_track *track) |
2214 |
+ track->cb_color_info[i] = 0; |
2215 |
+ track->cb_color_view[i] = 0xFFFFFFFF; |
2216 |
+ track->cb_color_pitch[i] = 0; |
2217 |
+- track->cb_color_slice[i] = 0; |
2218 |
++ track->cb_color_slice[i] = 0xfffffff; |
2219 |
++ track->cb_color_slice_idx[i] = 0; |
2220 |
+ } |
2221 |
+ track->cb_target_mask = 0xFFFFFFFF; |
2222 |
+ track->cb_shader_mask = 0xFFFFFFFF; |
2223 |
+ track->cb_dirty = true; |
2224 |
+ |
2225 |
++ track->db_depth_slice = 0xffffffff; |
2226 |
+ track->db_depth_view = 0xFFFFC000; |
2227 |
+ track->db_depth_size = 0xFFFFFFFF; |
2228 |
+ track->db_depth_control = 0xFFFFFFFF; |
2229 |
+@@ -250,10 +253,9 @@ static int evergreen_surface_check_2d(struct radeon_cs_parser *p, |
2230 |
+ { |
2231 |
+ struct evergreen_cs_track *track = p->track; |
2232 |
+ unsigned palign, halign, tileb, slice_pt; |
2233 |
++ unsigned mtile_pr, mtile_ps, mtileb; |
2234 |
+ |
2235 |
+ tileb = 64 * surf->bpe * surf->nsamples; |
2236 |
+- palign = track->group_size / (8 * surf->bpe * surf->nsamples); |
2237 |
+- palign = MAX(8, palign); |
2238 |
+ slice_pt = 1; |
2239 |
+ if (tileb > surf->tsplit) { |
2240 |
+ slice_pt = tileb / surf->tsplit; |
2241 |
+@@ -262,7 +264,10 @@ static int evergreen_surface_check_2d(struct radeon_cs_parser *p, |
2242 |
+ /* macro tile width & height */ |
2243 |
+ palign = (8 * surf->bankw * track->npipes) * surf->mtilea; |
2244 |
+ halign = (8 * surf->bankh * surf->nbanks) / surf->mtilea; |
2245 |
+- surf->layer_size = surf->nbx * surf->nby * surf->bpe * slice_pt; |
2246 |
++ mtileb = (palign / 8) * (halign / 8) * tileb;; |
2247 |
++ mtile_pr = surf->nbx / palign; |
2248 |
++ mtile_ps = (mtile_pr * surf->nby) / halign; |
2249 |
++ surf->layer_size = mtile_ps * mtileb * slice_pt; |
2250 |
+ surf->base_align = (palign / 8) * (halign / 8) * tileb; |
2251 |
+ surf->palign = palign; |
2252 |
+ surf->halign = halign; |
2253 |
+@@ -434,6 +439,39 @@ static int evergreen_cs_track_validate_cb(struct radeon_cs_parser *p, unsigned i |
2254 |
+ |
2255 |
+ offset += surf.layer_size * mslice; |
2256 |
+ if (offset > radeon_bo_size(track->cb_color_bo[id])) { |
2257 |
++ /* old ddx are broken they allocate bo with w*h*bpp but |
2258 |
++ * program slice with ALIGN(h, 8), catch this and patch |
2259 |
++ * command stream. |
2260 |
++ */ |
2261 |
++ if (!surf.mode) { |
2262 |
++ volatile u32 *ib = p->ib->ptr; |
2263 |
++ unsigned long tmp, nby, bsize, size, min = 0; |
2264 |
++ |
2265 |
++ /* find the height the ddx wants */ |
2266 |
++ if (surf.nby > 8) { |
2267 |
++ min = surf.nby - 8; |
2268 |
++ } |
2269 |
++ bsize = radeon_bo_size(track->cb_color_bo[id]); |
2270 |
++ tmp = track->cb_color_bo_offset[id] << 8; |
2271 |
++ for (nby = surf.nby; nby > min; nby--) { |
2272 |
++ size = nby * surf.nbx * surf.bpe * surf.nsamples; |
2273 |
++ if ((tmp + size * mslice) <= bsize) { |
2274 |
++ break; |
2275 |
++ } |
2276 |
++ } |
2277 |
++ if (nby > min) { |
2278 |
++ surf.nby = nby; |
2279 |
++ slice = ((nby * surf.nbx) / 64) - 1; |
2280 |
++ if (!evergreen_surface_check(p, &surf, "cb")) { |
2281 |
++ /* check if this one works */ |
2282 |
++ tmp += surf.layer_size * mslice; |
2283 |
++ if (tmp <= bsize) { |
2284 |
++ ib[track->cb_color_slice_idx[id]] = slice; |
2285 |
++ goto old_ddx_ok; |
2286 |
++ } |
2287 |
++ } |
2288 |
++ } |
2289 |
++ } |
2290 |
+ dev_warn(p->dev, "%s:%d cb[%d] bo too small (layer size %d, " |
2291 |
+ "offset %d, max layer %d, bo size %ld, slice %d)\n", |
2292 |
+ __func__, __LINE__, id, surf.layer_size, |
2293 |
+@@ -446,6 +484,7 @@ static int evergreen_cs_track_validate_cb(struct radeon_cs_parser *p, unsigned i |
2294 |
+ surf.tsplit, surf.mtilea); |
2295 |
+ return -EINVAL; |
2296 |
+ } |
2297 |
++old_ddx_ok: |
2298 |
+ |
2299 |
+ return 0; |
2300 |
+ } |
2301 |
+@@ -1532,6 +1571,7 @@ static int evergreen_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx) |
2302 |
+ case CB_COLOR7_SLICE: |
2303 |
+ tmp = (reg - CB_COLOR0_SLICE) / 0x3c; |
2304 |
+ track->cb_color_slice[tmp] = radeon_get_ib_value(p, idx); |
2305 |
++ track->cb_color_slice_idx[tmp] = idx; |
2306 |
+ track->cb_dirty = true; |
2307 |
+ break; |
2308 |
+ case CB_COLOR8_SLICE: |
2309 |
+@@ -1540,6 +1580,7 @@ static int evergreen_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx) |
2310 |
+ case CB_COLOR11_SLICE: |
2311 |
+ tmp = ((reg - CB_COLOR8_SLICE) / 0x1c) + 8; |
2312 |
+ track->cb_color_slice[tmp] = radeon_get_ib_value(p, idx); |
2313 |
++ track->cb_color_slice_idx[tmp] = idx; |
2314 |
+ track->cb_dirty = true; |
2315 |
+ break; |
2316 |
+ case CB_COLOR0_ATTRIB: |
2317 |
+diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c |
2318 |
+index ef7bb3f..15250fb 100644 |
2319 |
+--- a/drivers/gpu/drm/radeon/radeon_drv.c |
2320 |
++++ b/drivers/gpu/drm/radeon/radeon_drv.c |
2321 |
+@@ -57,9 +57,10 @@ |
2322 |
+ * 2.13.0 - virtual memory support, streamout |
2323 |
+ * 2.14.0 - add evergreen tiling informations |
2324 |
+ * 2.15.0 - add max_pipes query |
2325 |
++ * 2.16.0 - fix evergreen 2D tiled surface calculation |
2326 |
+ */ |
2327 |
+ #define KMS_DRIVER_MAJOR 2 |
2328 |
+-#define KMS_DRIVER_MINOR 15 |
2329 |
++#define KMS_DRIVER_MINOR 16 |
2330 |
+ #define KMS_DRIVER_PATCHLEVEL 0 |
2331 |
+ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); |
2332 |
+ int radeon_driver_unload_kms(struct drm_device *dev); |
2333 |
+diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c |
2334 |
+index 1843418..8b73ae8 100644 |
2335 |
+--- a/drivers/gpu/drm/ttm/ttm_bo.c |
2336 |
++++ b/drivers/gpu/drm/ttm/ttm_bo.c |
2337 |
+@@ -1193,6 +1193,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev, |
2338 |
+ (*destroy)(bo); |
2339 |
+ else |
2340 |
+ kfree(bo); |
2341 |
++ ttm_mem_global_free(mem_glob, acc_size); |
2342 |
+ return -EINVAL; |
2343 |
+ } |
2344 |
+ bo->destroy = destroy; |
2345 |
+@@ -1294,22 +1295,14 @@ int ttm_bo_create(struct ttm_bo_device *bdev, |
2346 |
+ struct ttm_buffer_object **p_bo) |
2347 |
+ { |
2348 |
+ struct ttm_buffer_object *bo; |
2349 |
+- struct ttm_mem_global *mem_glob = bdev->glob->mem_glob; |
2350 |
+ size_t acc_size; |
2351 |
+ int ret; |
2352 |
+ |
2353 |
+- acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object)); |
2354 |
+- ret = ttm_mem_global_alloc(mem_glob, acc_size, false, false); |
2355 |
+- if (unlikely(ret != 0)) |
2356 |
+- return ret; |
2357 |
+- |
2358 |
+ bo = kzalloc(sizeof(*bo), GFP_KERNEL); |
2359 |
+- |
2360 |
+- if (unlikely(bo == NULL)) { |
2361 |
+- ttm_mem_global_free(mem_glob, acc_size); |
2362 |
++ if (unlikely(bo == NULL)) |
2363 |
+ return -ENOMEM; |
2364 |
+- } |
2365 |
+ |
2366 |
++ acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object)); |
2367 |
+ ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment, |
2368 |
+ buffer_start, interruptible, |
2369 |
+ persistent_swap_storage, acc_size, NULL); |
2370 |
+diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c |
2371 |
+index 536bda0..8dc84d6 100644 |
2372 |
+--- a/drivers/net/can/c_can/c_can.c |
2373 |
++++ b/drivers/net/can/c_can/c_can.c |
2374 |
+@@ -686,7 +686,7 @@ static int c_can_get_berr_counter(const struct net_device *dev, |
2375 |
+ * |
2376 |
+ * We iterate from priv->tx_echo to priv->tx_next and check if the |
2377 |
+ * packet has been transmitted, echo it back to the CAN framework. |
2378 |
+- * If we discover a not yet transmitted package, stop looking for more. |
2379 |
++ * If we discover a not yet transmitted packet, stop looking for more. |
2380 |
+ */ |
2381 |
+ static void c_can_do_tx(struct net_device *dev) |
2382 |
+ { |
2383 |
+@@ -698,7 +698,7 @@ static void c_can_do_tx(struct net_device *dev) |
2384 |
+ for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) { |
2385 |
+ msg_obj_no = get_tx_echo_msg_obj(priv); |
2386 |
+ val = c_can_read_reg32(priv, &priv->regs->txrqst1); |
2387 |
+- if (!(val & (1 << msg_obj_no))) { |
2388 |
++ if (!(val & (1 << (msg_obj_no - 1)))) { |
2389 |
+ can_get_echo_skb(dev, |
2390 |
+ msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST); |
2391 |
+ stats->tx_bytes += priv->read_reg(priv, |
2392 |
+@@ -706,6 +706,8 @@ static void c_can_do_tx(struct net_device *dev) |
2393 |
+ & IF_MCONT_DLC_MASK; |
2394 |
+ stats->tx_packets++; |
2395 |
+ c_can_inval_msg_object(dev, 0, msg_obj_no); |
2396 |
++ } else { |
2397 |
++ break; |
2398 |
+ } |
2399 |
+ } |
2400 |
+ |
2401 |
+@@ -950,7 +952,7 @@ static int c_can_poll(struct napi_struct *napi, int quota) |
2402 |
+ struct net_device *dev = napi->dev; |
2403 |
+ struct c_can_priv *priv = netdev_priv(dev); |
2404 |
+ |
2405 |
+- irqstatus = priv->read_reg(priv, &priv->regs->interrupt); |
2406 |
++ irqstatus = priv->irqstatus; |
2407 |
+ if (!irqstatus) |
2408 |
+ goto end; |
2409 |
+ |
2410 |
+@@ -1028,12 +1030,11 @@ end: |
2411 |
+ |
2412 |
+ static irqreturn_t c_can_isr(int irq, void *dev_id) |
2413 |
+ { |
2414 |
+- u16 irqstatus; |
2415 |
+ struct net_device *dev = (struct net_device *)dev_id; |
2416 |
+ struct c_can_priv *priv = netdev_priv(dev); |
2417 |
+ |
2418 |
+- irqstatus = priv->read_reg(priv, &priv->regs->interrupt); |
2419 |
+- if (!irqstatus) |
2420 |
++ priv->irqstatus = priv->read_reg(priv, &priv->regs->interrupt); |
2421 |
++ if (!priv->irqstatus) |
2422 |
+ return IRQ_NONE; |
2423 |
+ |
2424 |
+ /* disable all interrupts and schedule the NAPI */ |
2425 |
+@@ -1063,10 +1064,11 @@ static int c_can_open(struct net_device *dev) |
2426 |
+ goto exit_irq_fail; |
2427 |
+ } |
2428 |
+ |
2429 |
++ napi_enable(&priv->napi); |
2430 |
++ |
2431 |
+ /* start the c_can controller */ |
2432 |
+ c_can_start(dev); |
2433 |
+ |
2434 |
+- napi_enable(&priv->napi); |
2435 |
+ netif_start_queue(dev); |
2436 |
+ |
2437 |
+ return 0; |
2438 |
+diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h |
2439 |
+index 9b7fbef..5f32d34 100644 |
2440 |
+--- a/drivers/net/can/c_can/c_can.h |
2441 |
++++ b/drivers/net/can/c_can/c_can.h |
2442 |
+@@ -76,6 +76,7 @@ struct c_can_priv { |
2443 |
+ unsigned int tx_next; |
2444 |
+ unsigned int tx_echo; |
2445 |
+ void *priv; /* for board-specific data */ |
2446 |
++ u16 irqstatus; |
2447 |
+ }; |
2448 |
+ |
2449 |
+ struct net_device *alloc_c_can_dev(void); |
2450 |
+diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c |
2451 |
+index b59cf20..cc9776c 100644 |
2452 |
+--- a/drivers/net/usb/sierra_net.c |
2453 |
++++ b/drivers/net/usb/sierra_net.c |
2454 |
+@@ -946,7 +946,7 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb, |
2455 |
+ } |
2456 |
+ |
2457 |
+ static const u8 sierra_net_ifnum_list[] = { 7, 10, 11 }; |
2458 |
+-static const struct sierra_net_info_data sierra_net_info_data_68A3 = { |
2459 |
++static const struct sierra_net_info_data sierra_net_info_data_direct_ip = { |
2460 |
+ .rx_urb_size = 8 * 1024, |
2461 |
+ .whitelist = { |
2462 |
+ .infolen = ARRAY_SIZE(sierra_net_ifnum_list), |
2463 |
+@@ -954,7 +954,7 @@ static const struct sierra_net_info_data sierra_net_info_data_68A3 = { |
2464 |
+ } |
2465 |
+ }; |
2466 |
+ |
2467 |
+-static const struct driver_info sierra_net_info_68A3 = { |
2468 |
++static const struct driver_info sierra_net_info_direct_ip = { |
2469 |
+ .description = "Sierra Wireless USB-to-WWAN Modem", |
2470 |
+ .flags = FLAG_WWAN | FLAG_SEND_ZLP, |
2471 |
+ .bind = sierra_net_bind, |
2472 |
+@@ -962,12 +962,18 @@ static const struct driver_info sierra_net_info_68A3 = { |
2473 |
+ .status = sierra_net_status, |
2474 |
+ .rx_fixup = sierra_net_rx_fixup, |
2475 |
+ .tx_fixup = sierra_net_tx_fixup, |
2476 |
+- .data = (unsigned long)&sierra_net_info_data_68A3, |
2477 |
++ .data = (unsigned long)&sierra_net_info_data_direct_ip, |
2478 |
+ }; |
2479 |
+ |
2480 |
+ static const struct usb_device_id products[] = { |
2481 |
+ {USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless USB-to-WWAN modem */ |
2482 |
+- .driver_info = (unsigned long) &sierra_net_info_68A3}, |
2483 |
++ .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
2484 |
++ {USB_DEVICE(0x0F3D, 0x68A3), /* AT&T Direct IP modem */ |
2485 |
++ .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
2486 |
++ {USB_DEVICE(0x1199, 0x68AA), /* Sierra Wireless Direct IP LTE modem */ |
2487 |
++ .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
2488 |
++ {USB_DEVICE(0x0F3D, 0x68AA), /* AT&T Direct IP LTE modem */ |
2489 |
++ .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
2490 |
+ |
2491 |
+ {}, /* last item */ |
2492 |
+ }; |
2493 |
+diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c |
2494 |
+index c417560..bef3f24 100644 |
2495 |
+--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c |
2496 |
++++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c |
2497 |
+@@ -1222,7 +1222,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, |
2498 |
+ key_flags |= STA_KEY_MULTICAST_MSK; |
2499 |
+ |
2500 |
+ sta_cmd.key.key_flags = key_flags; |
2501 |
+- sta_cmd.key.key_offset = WEP_INVALID_OFFSET; |
2502 |
++ sta_cmd.key.key_offset = keyconf->hw_key_idx; |
2503 |
+ sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK; |
2504 |
+ sta_cmd.mode = STA_CONTROL_MODIFY_MSK; |
2505 |
+ |
2506 |
+diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c |
2507 |
+index c24a713..1018f9b 100644 |
2508 |
+--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c |
2509 |
++++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c |
2510 |
+@@ -196,6 +196,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, |
2511 |
+ WIPHY_FLAG_DISABLE_BEACON_HINTS | |
2512 |
+ WIPHY_FLAG_IBSS_RSN; |
2513 |
+ |
2514 |
++#ifdef CONFIG_PM_SLEEP |
2515 |
+ if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len && |
2516 |
+ trans(priv)->ops->wowlan_suspend && |
2517 |
+ device_can_wakeup(trans(priv)->dev)) { |
2518 |
+@@ -214,6 +215,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, |
2519 |
+ hw->wiphy->wowlan.pattern_max_len = |
2520 |
+ IWLAGN_WOWLAN_MAX_PATTERN_LEN; |
2521 |
+ } |
2522 |
++#endif |
2523 |
+ |
2524 |
+ if (iwlagn_mod_params.power_save) |
2525 |
+ hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; |
2526 |
+@@ -243,6 +245,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, |
2527 |
+ ret = ieee80211_register_hw(priv->hw); |
2528 |
+ if (ret) { |
2529 |
+ IWL_ERR(priv, "Failed to register hw (error %d)\n", ret); |
2530 |
++ iwl_leds_exit(priv); |
2531 |
+ return ret; |
2532 |
+ } |
2533 |
+ priv->mac80211_registered = 1; |
2534 |
+diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h |
2535 |
+index 3b10692..dfd5466 100644 |
2536 |
+--- a/drivers/net/wireless/iwlwifi/iwl-prph.h |
2537 |
++++ b/drivers/net/wireless/iwlwifi/iwl-prph.h |
2538 |
+@@ -224,6 +224,7 @@ |
2539 |
+ #define SCD_TXFACT (SCD_BASE + 0x10) |
2540 |
+ #define SCD_ACTIVE (SCD_BASE + 0x14) |
2541 |
+ #define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8) |
2542 |
++#define SCD_CHAINEXT_EN (SCD_BASE + 0x244) |
2543 |
+ #define SCD_AGGR_SEL (SCD_BASE + 0x248) |
2544 |
+ #define SCD_INTERRUPT_MASK (SCD_BASE + 0x108) |
2545 |
+ |
2546 |
+diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c |
2547 |
+index 4d7b30d..66df016 100644 |
2548 |
+--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c |
2549 |
++++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c |
2550 |
+@@ -1128,6 +1128,11 @@ static void iwl_tx_start(struct iwl_trans *trans) |
2551 |
+ iwl_write_prph(trans, SCD_DRAM_BASE_ADDR, |
2552 |
+ trans_pcie->scd_bc_tbls.dma >> 10); |
2553 |
+ |
2554 |
++ /* The chain extension of the SCD doesn't work well. This feature is |
2555 |
++ * enabled by default by the HW, so we need to disable it manually. |
2556 |
++ */ |
2557 |
++ iwl_write_prph(trans, SCD_CHAINEXT_EN, 0); |
2558 |
++ |
2559 |
+ /* Enable DMA channel */ |
2560 |
+ for (chan = 0; chan < FH_TCSR_CHNL_NUM ; chan++) |
2561 |
+ iwl_write_direct32(trans, FH_TCSR_CHNL_TX_CONFIG_REG(chan), |
2562 |
+diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c |
2563 |
+index 001735f..5601302 100644 |
2564 |
+--- a/drivers/net/wireless/rt2x00/rt2800usb.c |
2565 |
++++ b/drivers/net/wireless/rt2x00/rt2800usb.c |
2566 |
+@@ -922,6 +922,7 @@ static struct usb_device_id rt2800usb_device_table[] = { |
2567 |
+ { USB_DEVICE(0x1482, 0x3c09) }, |
2568 |
+ /* AirTies */ |
2569 |
+ { USB_DEVICE(0x1eda, 0x2012) }, |
2570 |
++ { USB_DEVICE(0x1eda, 0x2210) }, |
2571 |
+ { USB_DEVICE(0x1eda, 0x2310) }, |
2572 |
+ /* Allwin */ |
2573 |
+ { USB_DEVICE(0x8516, 0x2070) }, |
2574 |
+@@ -991,6 +992,7 @@ static struct usb_device_id rt2800usb_device_table[] = { |
2575 |
+ /* DVICO */ |
2576 |
+ { USB_DEVICE(0x0fe9, 0xb307) }, |
2577 |
+ /* Edimax */ |
2578 |
++ { USB_DEVICE(0x7392, 0x4085) }, |
2579 |
+ { USB_DEVICE(0x7392, 0x7711) }, |
2580 |
+ { USB_DEVICE(0x7392, 0x7717) }, |
2581 |
+ { USB_DEVICE(0x7392, 0x7718) }, |
2582 |
+@@ -1066,6 +1068,7 @@ static struct usb_device_id rt2800usb_device_table[] = { |
2583 |
+ /* Philips */ |
2584 |
+ { USB_DEVICE(0x0471, 0x200f) }, |
2585 |
+ /* Planex */ |
2586 |
++ { USB_DEVICE(0x2019, 0x5201) }, |
2587 |
+ { USB_DEVICE(0x2019, 0xab25) }, |
2588 |
+ { USB_DEVICE(0x2019, 0xed06) }, |
2589 |
+ /* Quanta */ |
2590 |
+@@ -1134,6 +1137,10 @@ static struct usb_device_id rt2800usb_device_table[] = { |
2591 |
+ #ifdef CONFIG_RT2800USB_RT33XX |
2592 |
+ /* Belkin */ |
2593 |
+ { USB_DEVICE(0x050d, 0x945b) }, |
2594 |
++ /* Panasonic */ |
2595 |
++ { USB_DEVICE(0x083a, 0xb511) }, |
2596 |
++ /* Philips */ |
2597 |
++ { USB_DEVICE(0x0471, 0x20dd) }, |
2598 |
+ /* Ralink */ |
2599 |
+ { USB_DEVICE(0x148f, 0x3370) }, |
2600 |
+ { USB_DEVICE(0x148f, 0x8070) }, |
2601 |
+@@ -1145,6 +1152,8 @@ static struct usb_device_id rt2800usb_device_table[] = { |
2602 |
+ { USB_DEVICE(0x8516, 0x3572) }, |
2603 |
+ /* Askey */ |
2604 |
+ { USB_DEVICE(0x1690, 0x0744) }, |
2605 |
++ { USB_DEVICE(0x1690, 0x0761) }, |
2606 |
++ { USB_DEVICE(0x1690, 0x0764) }, |
2607 |
+ /* Cisco */ |
2608 |
+ { USB_DEVICE(0x167b, 0x4001) }, |
2609 |
+ /* EnGenius */ |
2610 |
+@@ -1159,20 +1168,25 @@ static struct usb_device_id rt2800usb_device_table[] = { |
2611 |
+ /* Sitecom */ |
2612 |
+ { USB_DEVICE(0x0df6, 0x0041) }, |
2613 |
+ { USB_DEVICE(0x0df6, 0x0062) }, |
2614 |
++ { USB_DEVICE(0x0df6, 0x0065) }, |
2615 |
++ { USB_DEVICE(0x0df6, 0x0066) }, |
2616 |
++ { USB_DEVICE(0x0df6, 0x0068) }, |
2617 |
+ /* Toshiba */ |
2618 |
+ { USB_DEVICE(0x0930, 0x0a07) }, |
2619 |
+ /* Zinwell */ |
2620 |
+ { USB_DEVICE(0x5a57, 0x0284) }, |
2621 |
+ #endif |
2622 |
+ #ifdef CONFIG_RT2800USB_RT53XX |
2623 |
+- /* Alpha */ |
2624 |
+- { USB_DEVICE(0x2001, 0x3c15) }, |
2625 |
+- { USB_DEVICE(0x2001, 0x3c19) }, |
2626 |
+ /* Arcadyan */ |
2627 |
+ { USB_DEVICE(0x043e, 0x7a12) }, |
2628 |
+ /* Azurewave */ |
2629 |
+ { USB_DEVICE(0x13d3, 0x3329) }, |
2630 |
+ { USB_DEVICE(0x13d3, 0x3365) }, |
2631 |
++ /* D-Link */ |
2632 |
++ { USB_DEVICE(0x2001, 0x3c15) }, |
2633 |
++ { USB_DEVICE(0x2001, 0x3c19) }, |
2634 |
++ { USB_DEVICE(0x2001, 0x3c1c) }, |
2635 |
++ { USB_DEVICE(0x2001, 0x3c1d) }, |
2636 |
+ /* LG innotek */ |
2637 |
+ { USB_DEVICE(0x043e, 0x7a22) }, |
2638 |
+ /* Panasonic */ |
2639 |
+@@ -1224,12 +1238,8 @@ static struct usb_device_id rt2800usb_device_table[] = { |
2640 |
+ { USB_DEVICE(0x07d1, 0x3c0b) }, |
2641 |
+ { USB_DEVICE(0x07d1, 0x3c17) }, |
2642 |
+ { USB_DEVICE(0x2001, 0x3c17) }, |
2643 |
+- /* Edimax */ |
2644 |
+- { USB_DEVICE(0x7392, 0x4085) }, |
2645 |
+ /* Encore */ |
2646 |
+ { USB_DEVICE(0x203d, 0x14a1) }, |
2647 |
+- /* Fujitsu Stylistic 550 */ |
2648 |
+- { USB_DEVICE(0x1690, 0x0761) }, |
2649 |
+ /* Gemtek */ |
2650 |
+ { USB_DEVICE(0x15a9, 0x0010) }, |
2651 |
+ /* Gigabyte */ |
2652 |
+@@ -1250,7 +1260,6 @@ static struct usb_device_id rt2800usb_device_table[] = { |
2653 |
+ { USB_DEVICE(0x05a6, 0x0101) }, |
2654 |
+ { USB_DEVICE(0x1d4d, 0x0010) }, |
2655 |
+ /* Planex */ |
2656 |
+- { USB_DEVICE(0x2019, 0x5201) }, |
2657 |
+ { USB_DEVICE(0x2019, 0xab24) }, |
2658 |
+ /* Qcom */ |
2659 |
+ { USB_DEVICE(0x18e8, 0x6259) }, |
2660 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h |
2661 |
+index 471f87c..c264dfa 100644 |
2662 |
+--- a/drivers/net/wireless/rt2x00/rt2x00.h |
2663 |
++++ b/drivers/net/wireless/rt2x00/rt2x00.h |
2664 |
+@@ -396,8 +396,7 @@ struct rt2x00_intf { |
2665 |
+ * for hardware which doesn't support hardware |
2666 |
+ * sequence counting. |
2667 |
+ */ |
2668 |
+- spinlock_t seqlock; |
2669 |
+- u16 seqno; |
2670 |
++ atomic_t seqno; |
2671 |
+ }; |
2672 |
+ |
2673 |
+ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) |
2674 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c |
2675 |
+index 2df2eb6..a8885f0 100644 |
2676 |
+--- a/drivers/net/wireless/rt2x00/rt2x00mac.c |
2677 |
++++ b/drivers/net/wireless/rt2x00/rt2x00mac.c |
2678 |
+@@ -277,7 +277,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, |
2679 |
+ else |
2680 |
+ rt2x00dev->intf_sta_count++; |
2681 |
+ |
2682 |
+- spin_lock_init(&intf->seqlock); |
2683 |
+ mutex_init(&intf->beacon_skb_mutex); |
2684 |
+ intf->beacon = entry; |
2685 |
+ |
2686 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c |
2687 |
+index 9b1b2b7..50f92d5 100644 |
2688 |
+--- a/drivers/net/wireless/rt2x00/rt2x00queue.c |
2689 |
++++ b/drivers/net/wireless/rt2x00/rt2x00queue.c |
2690 |
+@@ -207,6 +207,7 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev, |
2691 |
+ struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
2692 |
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
2693 |
+ struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); |
2694 |
++ u16 seqno; |
2695 |
+ |
2696 |
+ if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)) |
2697 |
+ return; |
2698 |
+@@ -227,15 +228,13 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev, |
2699 |
+ * sequence counting per-frame, since those will override the |
2700 |
+ * sequence counter given by mac80211. |
2701 |
+ */ |
2702 |
+- spin_lock(&intf->seqlock); |
2703 |
+- |
2704 |
+ if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) |
2705 |
+- intf->seqno += 0x10; |
2706 |
+- hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); |
2707 |
+- hdr->seq_ctrl |= cpu_to_le16(intf->seqno); |
2708 |
+- |
2709 |
+- spin_unlock(&intf->seqlock); |
2710 |
++ seqno = atomic_add_return(0x10, &intf->seqno); |
2711 |
++ else |
2712 |
++ seqno = atomic_read(&intf->seqno); |
2713 |
+ |
2714 |
++ hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); |
2715 |
++ hdr->seq_ctrl |= cpu_to_le16(seqno); |
2716 |
+ } |
2717 |
+ |
2718 |
+ static void rt2x00queue_create_tx_descriptor_plcp(struct rt2x00_dev *rt2x00dev, |
2719 |
+diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c |
2720 |
+index 61b16c6..0df0d1f 100644 |
2721 |
+--- a/fs/btrfs/inode.c |
2722 |
++++ b/fs/btrfs/inode.c |
2723 |
+@@ -257,10 +257,13 @@ static noinline int cow_file_range_inline(struct btrfs_trans_handle *trans, |
2724 |
+ ret = insert_inline_extent(trans, root, inode, start, |
2725 |
+ inline_len, compressed_size, |
2726 |
+ compress_type, compressed_pages); |
2727 |
+- if (ret) { |
2728 |
++ if (ret && ret != -ENOSPC) { |
2729 |
+ btrfs_abort_transaction(trans, root, ret); |
2730 |
+ return ret; |
2731 |
++ } else if (ret == -ENOSPC) { |
2732 |
++ return 1; |
2733 |
+ } |
2734 |
++ |
2735 |
+ btrfs_delalloc_release_metadata(inode, end + 1 - start); |
2736 |
+ btrfs_drop_extent_cache(inode, start, aligned_end - 1, 0); |
2737 |
+ return 0; |
2738 |
+diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c |
2739 |
+index 4bbd07a..8da837b 100644 |
2740 |
+--- a/fs/ext4/balloc.c |
2741 |
++++ b/fs/ext4/balloc.c |
2742 |
+@@ -90,8 +90,8 @@ unsigned ext4_num_overhead_clusters(struct super_block *sb, |
2743 |
+ * unusual file system layouts. |
2744 |
+ */ |
2745 |
+ if (ext4_block_in_group(sb, ext4_block_bitmap(sb, gdp), block_group)) { |
2746 |
+- block_cluster = EXT4_B2C(sbi, (start - |
2747 |
+- ext4_block_bitmap(sb, gdp))); |
2748 |
++ block_cluster = EXT4_B2C(sbi, |
2749 |
++ ext4_block_bitmap(sb, gdp) - start); |
2750 |
+ if (block_cluster < num_clusters) |
2751 |
+ block_cluster = -1; |
2752 |
+ else if (block_cluster == num_clusters) { |
2753 |
+@@ -102,7 +102,7 @@ unsigned ext4_num_overhead_clusters(struct super_block *sb, |
2754 |
+ |
2755 |
+ if (ext4_block_in_group(sb, ext4_inode_bitmap(sb, gdp), block_group)) { |
2756 |
+ inode_cluster = EXT4_B2C(sbi, |
2757 |
+- start - ext4_inode_bitmap(sb, gdp)); |
2758 |
++ ext4_inode_bitmap(sb, gdp) - start); |
2759 |
+ if (inode_cluster < num_clusters) |
2760 |
+ inode_cluster = -1; |
2761 |
+ else if (inode_cluster == num_clusters) { |
2762 |
+@@ -114,7 +114,7 @@ unsigned ext4_num_overhead_clusters(struct super_block *sb, |
2763 |
+ itbl_blk = ext4_inode_table(sb, gdp); |
2764 |
+ for (i = 0; i < sbi->s_itb_per_group; i++) { |
2765 |
+ if (ext4_block_in_group(sb, itbl_blk + i, block_group)) { |
2766 |
+- c = EXT4_B2C(sbi, start - itbl_blk + i); |
2767 |
++ c = EXT4_B2C(sbi, itbl_blk + i - start); |
2768 |
+ if ((c < num_clusters) || (c == inode_cluster) || |
2769 |
+ (c == block_cluster) || (c == itbl_cluster)) |
2770 |
+ continue; |
2771 |
+diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c |
2772 |
+index df5ac04..bc43832 100644 |
2773 |
+--- a/fs/fuse/dir.c |
2774 |
++++ b/fs/fuse/dir.c |
2775 |
+@@ -863,6 +863,7 @@ int fuse_update_attributes(struct inode *inode, struct kstat *stat, |
2776 |
+ if (stat) { |
2777 |
+ generic_fillattr(inode, stat); |
2778 |
+ stat->mode = fi->orig_i_mode; |
2779 |
++ stat->ino = fi->orig_ino; |
2780 |
+ } |
2781 |
+ } |
2782 |
+ |
2783 |
+diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h |
2784 |
+index 572cefc..d181926 100644 |
2785 |
+--- a/fs/fuse/fuse_i.h |
2786 |
++++ b/fs/fuse/fuse_i.h |
2787 |
+@@ -82,6 +82,9 @@ struct fuse_inode { |
2788 |
+ preserve the original mode */ |
2789 |
+ umode_t orig_i_mode; |
2790 |
+ |
2791 |
++ /** 64 bit inode number */ |
2792 |
++ u64 orig_ino; |
2793 |
++ |
2794 |
+ /** Version of last attribute change */ |
2795 |
+ u64 attr_version; |
2796 |
+ |
2797 |
+diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c |
2798 |
+index 26783eb..a59cf5e 100644 |
2799 |
+--- a/fs/fuse/inode.c |
2800 |
++++ b/fs/fuse/inode.c |
2801 |
+@@ -91,6 +91,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) |
2802 |
+ fi->nlookup = 0; |
2803 |
+ fi->attr_version = 0; |
2804 |
+ fi->writectr = 0; |
2805 |
++ fi->orig_ino = 0; |
2806 |
+ INIT_LIST_HEAD(&fi->write_files); |
2807 |
+ INIT_LIST_HEAD(&fi->queued_writes); |
2808 |
+ INIT_LIST_HEAD(&fi->writepages); |
2809 |
+@@ -139,6 +140,18 @@ static int fuse_remount_fs(struct super_block *sb, int *flags, char *data) |
2810 |
+ return 0; |
2811 |
+ } |
2812 |
+ |
2813 |
++/* |
2814 |
++ * ino_t is 32-bits on 32-bit arch. We have to squash the 64-bit value down |
2815 |
++ * so that it will fit. |
2816 |
++ */ |
2817 |
++static ino_t fuse_squash_ino(u64 ino64) |
2818 |
++{ |
2819 |
++ ino_t ino = (ino_t) ino64; |
2820 |
++ if (sizeof(ino_t) < sizeof(u64)) |
2821 |
++ ino ^= ino64 >> (sizeof(u64) - sizeof(ino_t)) * 8; |
2822 |
++ return ino; |
2823 |
++} |
2824 |
++ |
2825 |
+ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, |
2826 |
+ u64 attr_valid) |
2827 |
+ { |
2828 |
+@@ -148,7 +161,7 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, |
2829 |
+ fi->attr_version = ++fc->attr_version; |
2830 |
+ fi->i_time = attr_valid; |
2831 |
+ |
2832 |
+- inode->i_ino = attr->ino; |
2833 |
++ inode->i_ino = fuse_squash_ino(attr->ino); |
2834 |
+ inode->i_mode = (inode->i_mode & S_IFMT) | (attr->mode & 07777); |
2835 |
+ set_nlink(inode, attr->nlink); |
2836 |
+ inode->i_uid = attr->uid; |
2837 |
+@@ -174,6 +187,8 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, |
2838 |
+ fi->orig_i_mode = inode->i_mode; |
2839 |
+ if (!(fc->flags & FUSE_DEFAULT_PERMISSIONS)) |
2840 |
+ inode->i_mode &= ~S_ISVTX; |
2841 |
++ |
2842 |
++ fi->orig_ino = attr->ino; |
2843 |
+ } |
2844 |
+ |
2845 |
+ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, |
2846 |
+diff --git a/include/linux/libata.h b/include/linux/libata.h |
2847 |
+index e926df7..6e887c7 100644 |
2848 |
+--- a/include/linux/libata.h |
2849 |
++++ b/include/linux/libata.h |
2850 |
+@@ -247,6 +247,7 @@ enum { |
2851 |
+ ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ |
2852 |
+ ATA_HOST_STARTED = (1 << 1), /* Host started */ |
2853 |
+ ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */ |
2854 |
++ ATA_HOST_IGNORE_ATA = (1 << 3), /* Ignore ATA devices on this host. */ |
2855 |
+ |
2856 |
+ /* bits 24:31 of host->flags are reserved for LLD specific flags */ |
2857 |
+ |
2858 |
+diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h |
2859 |
+index ea36486..944bc18 100644 |
2860 |
+--- a/include/linux/moduleparam.h |
2861 |
++++ b/include/linux/moduleparam.h |
2862 |
+@@ -128,7 +128,7 @@ struct kparam_array |
2863 |
+ * The ops can have NULL set or get functions. |
2864 |
+ */ |
2865 |
+ #define module_param_cb(name, ops, arg, perm) \ |
2866 |
+- __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, 0) |
2867 |
++ __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1) |
2868 |
+ |
2869 |
+ /** |
2870 |
+ * <level>_param_cb - general callback for a module/cmdline parameter |
2871 |
+@@ -192,7 +192,7 @@ struct kparam_array |
2872 |
+ { (void *)set, (void *)get }; \ |
2873 |
+ __module_param_call(MODULE_PARAM_PREFIX, \ |
2874 |
+ name, &__param_ops_##name, arg, \ |
2875 |
+- (perm) + sizeof(__check_old_set_param(set))*0, 0) |
2876 |
++ (perm) + sizeof(__check_old_set_param(set))*0, -1) |
2877 |
+ |
2878 |
+ /* We don't get oldget: it's often a new-style param_get_uint, etc. */ |
2879 |
+ static inline int |
2880 |
+@@ -272,7 +272,7 @@ static inline void __kernel_param_unlock(void) |
2881 |
+ */ |
2882 |
+ #define core_param(name, var, type, perm) \ |
2883 |
+ param_check_##type(name, &(var)); \ |
2884 |
+- __module_param_call("", name, ¶m_ops_##type, &var, perm, 0) |
2885 |
++ __module_param_call("", name, ¶m_ops_##type, &var, perm, -1) |
2886 |
+ #endif /* !MODULE */ |
2887 |
+ |
2888 |
+ /** |
2889 |
+@@ -290,7 +290,7 @@ static inline void __kernel_param_unlock(void) |
2890 |
+ = { len, string }; \ |
2891 |
+ __module_param_call(MODULE_PARAM_PREFIX, name, \ |
2892 |
+ ¶m_ops_string, \ |
2893 |
+- .str = &__param_string_##name, perm, 0); \ |
2894 |
++ .str = &__param_string_##name, perm, -1); \ |
2895 |
+ __MODULE_PARM_TYPE(name, "string") |
2896 |
+ |
2897 |
+ /** |
2898 |
+@@ -431,7 +431,7 @@ extern int param_set_bint(const char *val, const struct kernel_param *kp); |
2899 |
+ __module_param_call(MODULE_PARAM_PREFIX, name, \ |
2900 |
+ ¶m_array_ops, \ |
2901 |
+ .arr = &__param_arr_##name, \ |
2902 |
+- perm, 0); \ |
2903 |
++ perm, -1); \ |
2904 |
+ __MODULE_PARM_TYPE(name, "array of " #type) |
2905 |
+ |
2906 |
+ extern struct kernel_param_ops param_array_ops; |
2907 |
+diff --git a/init/main.c b/init/main.c |
2908 |
+index cb54cd3..b08c5f7 100644 |
2909 |
+--- a/init/main.c |
2910 |
++++ b/init/main.c |
2911 |
+@@ -508,7 +508,7 @@ asmlinkage void __init start_kernel(void) |
2912 |
+ parse_early_param(); |
2913 |
+ parse_args("Booting kernel", static_command_line, __start___param, |
2914 |
+ __stop___param - __start___param, |
2915 |
+- 0, 0, &unknown_bootoption); |
2916 |
++ -1, -1, &unknown_bootoption); |
2917 |
+ |
2918 |
+ jump_label_init(); |
2919 |
+ |
2920 |
+diff --git a/kernel/sched/core.c b/kernel/sched/core.c |
2921 |
+index e5212ae..2000e06 100644 |
2922 |
+--- a/kernel/sched/core.c |
2923 |
++++ b/kernel/sched/core.c |
2924 |
+@@ -6230,11 +6230,8 @@ int sched_domain_level_max; |
2925 |
+ |
2926 |
+ static int __init setup_relax_domain_level(char *str) |
2927 |
+ { |
2928 |
+- unsigned long val; |
2929 |
+- |
2930 |
+- val = simple_strtoul(str, NULL, 0); |
2931 |
+- if (val < sched_domain_level_max) |
2932 |
+- default_relax_domain_level = val; |
2933 |
++ if (kstrtoint(str, 0, &default_relax_domain_level)) |
2934 |
++ pr_warn("Unable to set relax_domain_level\n"); |
2935 |
+ |
2936 |
+ return 1; |
2937 |
+ } |
2938 |
+@@ -6439,7 +6436,6 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl, |
2939 |
+ if (!sd) |
2940 |
+ return child; |
2941 |
+ |
2942 |
+- set_domain_attribute(sd, attr); |
2943 |
+ cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu)); |
2944 |
+ if (child) { |
2945 |
+ sd->level = child->level + 1; |
2946 |
+@@ -6447,6 +6443,7 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl, |
2947 |
+ child->parent = sd; |
2948 |
+ } |
2949 |
+ sd->child = child; |
2950 |
++ set_domain_attribute(sd, attr); |
2951 |
+ |
2952 |
+ return sd; |
2953 |
+ } |
2954 |
+diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c |
2955 |
+index d66b213..d42574df 100644 |
2956 |
+--- a/kernel/time/timekeeping.c |
2957 |
++++ b/kernel/time/timekeeping.c |
2958 |
+@@ -964,6 +964,7 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift) |
2959 |
+ timekeeper.xtime.tv_sec++; |
2960 |
+ leap = second_overflow(timekeeper.xtime.tv_sec); |
2961 |
+ timekeeper.xtime.tv_sec += leap; |
2962 |
++ timekeeper.wall_to_monotonic.tv_sec -= leap; |
2963 |
+ } |
2964 |
+ |
2965 |
+ /* Accumulate raw time */ |
2966 |
+@@ -1079,6 +1080,7 @@ static void update_wall_time(void) |
2967 |
+ timekeeper.xtime.tv_sec++; |
2968 |
+ leap = second_overflow(timekeeper.xtime.tv_sec); |
2969 |
+ timekeeper.xtime.tv_sec += leap; |
2970 |
++ timekeeper.wall_to_monotonic.tv_sec -= leap; |
2971 |
+ } |
2972 |
+ |
2973 |
+ timekeeping_update(false); |
2974 |
+diff --git a/lib/btree.c b/lib/btree.c |
2975 |
+index e5ec1e9..5cf9e74 100644 |
2976 |
+--- a/lib/btree.c |
2977 |
++++ b/lib/btree.c |
2978 |
+@@ -319,8 +319,8 @@ void *btree_get_prev(struct btree_head *head, struct btree_geo *geo, |
2979 |
+ |
2980 |
+ if (head->height == 0) |
2981 |
+ return NULL; |
2982 |
+-retry: |
2983 |
+ longcpy(key, __key, geo->keylen); |
2984 |
++retry: |
2985 |
+ dec_key(geo, key); |
2986 |
+ |
2987 |
+ node = head->node; |
2988 |
+@@ -351,7 +351,7 @@ retry: |
2989 |
+ } |
2990 |
+ miss: |
2991 |
+ if (retry_key) { |
2992 |
+- __key = retry_key; |
2993 |
++ longcpy(key, retry_key, geo->keylen); |
2994 |
+ retry_key = NULL; |
2995 |
+ goto retry; |
2996 |
+ } |
2997 |
+diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c |
2998 |
+index c20051b..48f937e 100644 |
2999 |
+--- a/net/mac80211/iface.c |
3000 |
++++ b/net/mac80211/iface.c |
3001 |
+@@ -514,6 +514,18 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, |
3002 |
+ ieee80211_configure_filter(local); |
3003 |
+ break; |
3004 |
+ default: |
3005 |
++ mutex_lock(&local->mtx); |
3006 |
++ if (local->hw_roc_dev == sdata->dev && |
3007 |
++ local->hw_roc_channel) { |
3008 |
++ /* ignore return value since this is racy */ |
3009 |
++ drv_cancel_remain_on_channel(local); |
3010 |
++ ieee80211_queue_work(&local->hw, &local->hw_roc_done); |
3011 |
++ } |
3012 |
++ mutex_unlock(&local->mtx); |
3013 |
++ |
3014 |
++ flush_work(&local->hw_roc_start); |
3015 |
++ flush_work(&local->hw_roc_done); |
3016 |
++ |
3017 |
+ flush_work(&sdata->work); |
3018 |
+ /* |
3019 |
+ * When we get here, the interface is marked down. |
3020 |
+diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c |
3021 |
+index f054e94..935aa4b 100644 |
3022 |
+--- a/net/mac80211/offchannel.c |
3023 |
++++ b/net/mac80211/offchannel.c |
3024 |
+@@ -234,6 +234,22 @@ static void ieee80211_hw_roc_done(struct work_struct *work) |
3025 |
+ return; |
3026 |
+ } |
3027 |
+ |
3028 |
++ /* was never transmitted */ |
3029 |
++ if (local->hw_roc_skb) { |
3030 |
++ u64 cookie; |
3031 |
++ |
3032 |
++ cookie = local->hw_roc_cookie ^ 2; |
3033 |
++ |
3034 |
++ cfg80211_mgmt_tx_status(local->hw_roc_dev, cookie, |
3035 |
++ local->hw_roc_skb->data, |
3036 |
++ local->hw_roc_skb->len, false, |
3037 |
++ GFP_KERNEL); |
3038 |
++ |
3039 |
++ kfree_skb(local->hw_roc_skb); |
3040 |
++ local->hw_roc_skb = NULL; |
3041 |
++ local->hw_roc_skb_for_status = NULL; |
3042 |
++ } |
3043 |
++ |
3044 |
+ if (!local->hw_roc_for_tx) |
3045 |
+ cfg80211_remain_on_channel_expired(local->hw_roc_dev, |
3046 |
+ local->hw_roc_cookie, |
3047 |
+diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
3048 |
+index 38137cb..d93d39b 100644 |
3049 |
+--- a/net/mac80211/sta_info.c |
3050 |
++++ b/net/mac80211/sta_info.c |
3051 |
+@@ -378,7 +378,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) |
3052 |
+ /* make the station visible */ |
3053 |
+ sta_info_hash_add(local, sta); |
3054 |
+ |
3055 |
+- list_add(&sta->list, &local->sta_list); |
3056 |
++ list_add_rcu(&sta->list, &local->sta_list); |
3057 |
+ |
3058 |
+ set_sta_flag(sta, WLAN_STA_INSERTED); |
3059 |
+ |
3060 |
+@@ -688,7 +688,7 @@ int __must_check __sta_info_destroy(struct sta_info *sta) |
3061 |
+ if (ret) |
3062 |
+ return ret; |
3063 |
+ |
3064 |
+- list_del(&sta->list); |
3065 |
++ list_del_rcu(&sta->list); |
3066 |
+ |
3067 |
+ mutex_lock(&local->key_mtx); |
3068 |
+ for (i = 0; i < NUM_DEFAULT_KEYS; i++) |
3069 |
+diff --git a/net/mac80211/util.c b/net/mac80211/util.c |
3070 |
+index 3862c96..eb9d7c0 100644 |
3071 |
+--- a/net/mac80211/util.c |
3072 |
++++ b/net/mac80211/util.c |
3073 |
+@@ -1224,7 +1224,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) |
3074 |
+ enum ieee80211_sta_state state; |
3075 |
+ |
3076 |
+ for (state = IEEE80211_STA_NOTEXIST; |
3077 |
+- state < sta->sta_state - 1; state++) |
3078 |
++ state < sta->sta_state; state++) |
3079 |
+ WARN_ON(drv_sta_state(local, sta->sdata, sta, |
3080 |
+ state, state + 1)); |
3081 |
+ } |
3082 |
+diff --git a/net/wireless/util.c b/net/wireless/util.c |
3083 |
+index 957f2562..b5b6890 100644 |
3084 |
+--- a/net/wireless/util.c |
3085 |
++++ b/net/wireless/util.c |
3086 |
+@@ -936,6 +936,7 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev, |
3087 |
+ enum nl80211_iftype iftype) |
3088 |
+ { |
3089 |
+ struct wireless_dev *wdev_iter; |
3090 |
++ u32 used_iftypes = BIT(iftype); |
3091 |
+ int num[NUM_NL80211_IFTYPES]; |
3092 |
+ int total = 1; |
3093 |
+ int i, j; |
3094 |
+@@ -969,12 +970,14 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev, |
3095 |
+ |
3096 |
+ num[wdev_iter->iftype]++; |
3097 |
+ total++; |
3098 |
++ used_iftypes |= BIT(wdev_iter->iftype); |
3099 |
+ } |
3100 |
+ mutex_unlock(&rdev->devlist_mtx); |
3101 |
+ |
3102 |
+ for (i = 0; i < rdev->wiphy.n_iface_combinations; i++) { |
3103 |
+ const struct ieee80211_iface_combination *c; |
3104 |
+ struct ieee80211_iface_limit *limits; |
3105 |
++ u32 all_iftypes = 0; |
3106 |
+ |
3107 |
+ c = &rdev->wiphy.iface_combinations[i]; |
3108 |
+ |
3109 |
+@@ -989,6 +992,7 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev, |
3110 |
+ if (rdev->wiphy.software_iftypes & BIT(iftype)) |
3111 |
+ continue; |
3112 |
+ for (j = 0; j < c->n_limits; j++) { |
3113 |
++ all_iftypes |= limits[j].types; |
3114 |
+ if (!(limits[j].types & BIT(iftype))) |
3115 |
+ continue; |
3116 |
+ if (limits[j].max < num[iftype]) |
3117 |
+@@ -996,7 +1000,20 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev, |
3118 |
+ limits[j].max -= num[iftype]; |
3119 |
+ } |
3120 |
+ } |
3121 |
+- /* yay, it fits */ |
3122 |
++ |
3123 |
++ /* |
3124 |
++ * Finally check that all iftypes that we're currently |
3125 |
++ * using are actually part of this combination. If they |
3126 |
++ * aren't then we can't use this combination and have |
3127 |
++ * to continue to the next. |
3128 |
++ */ |
3129 |
++ if ((all_iftypes & used_iftypes) != used_iftypes) |
3130 |
++ goto cont; |
3131 |
++ |
3132 |
++ /* |
3133 |
++ * This combination covered all interface types and |
3134 |
++ * supported the requested numbers, so we're good. |
3135 |
++ */ |
3136 |
+ kfree(limits); |
3137 |
+ return 0; |
3138 |
+ cont: |
3139 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
3140 |
+index 7810913..e56c2c8 100644 |
3141 |
+--- a/sound/pci/hda/patch_realtek.c |
3142 |
++++ b/sound/pci/hda/patch_realtek.c |
3143 |
+@@ -6606,6 +6606,7 @@ enum { |
3144 |
+ ALC662_FIXUP_ASUS_MODE7, |
3145 |
+ ALC662_FIXUP_ASUS_MODE8, |
3146 |
+ ALC662_FIXUP_NO_JACK_DETECT, |
3147 |
++ ALC662_FIXUP_ZOTAC_Z68, |
3148 |
+ }; |
3149 |
+ |
3150 |
+ static const struct alc_fixup alc662_fixups[] = { |
3151 |
+@@ -6755,6 +6756,13 @@ static const struct alc_fixup alc662_fixups[] = { |
3152 |
+ .type = ALC_FIXUP_FUNC, |
3153 |
+ .v.func = alc_fixup_no_jack_detect, |
3154 |
+ }, |
3155 |
++ [ALC662_FIXUP_ZOTAC_Z68] = { |
3156 |
++ .type = ALC_FIXUP_PINS, |
3157 |
++ .v.pins = (const struct alc_pincfg[]) { |
3158 |
++ { 0x1b, 0x02214020 }, /* Front HP */ |
3159 |
++ { } |
3160 |
++ } |
3161 |
++ }, |
3162 |
+ }; |
3163 |
+ |
3164 |
+ static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
3165 |
+@@ -6768,6 +6776,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
3166 |
+ SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
3167 |
+ SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
3168 |
+ SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
3169 |
++ SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
3170 |
+ SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
3171 |
+ |
3172 |
+ #if 0 |
3173 |
+diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c |
3174 |
+index 2de12eb..f351b93 100644 |
3175 |
+--- a/sound/soc/codecs/wm8994.c |
3176 |
++++ b/sound/soc/codecs/wm8994.c |
3177 |
+@@ -46,6 +46,39 @@ |
3178 |
+ #define WM8994_NUM_DRC 3 |
3179 |
+ #define WM8994_NUM_EQ 3 |
3180 |
+ |
3181 |
++static struct { |
3182 |
++ unsigned int reg; |
3183 |
++ unsigned int mask; |
3184 |
++} wm8994_vu_bits[] = { |
3185 |
++ { WM8994_LEFT_LINE_INPUT_1_2_VOLUME, WM8994_IN1_VU }, |
3186 |
++ { WM8994_RIGHT_LINE_INPUT_1_2_VOLUME, WM8994_IN1_VU }, |
3187 |
++ { WM8994_LEFT_LINE_INPUT_3_4_VOLUME, WM8994_IN2_VU }, |
3188 |
++ { WM8994_RIGHT_LINE_INPUT_3_4_VOLUME, WM8994_IN2_VU }, |
3189 |
++ { WM8994_SPEAKER_VOLUME_LEFT, WM8994_SPKOUT_VU }, |
3190 |
++ { WM8994_SPEAKER_VOLUME_RIGHT, WM8994_SPKOUT_VU }, |
3191 |
++ { WM8994_LEFT_OUTPUT_VOLUME, WM8994_HPOUT1_VU }, |
3192 |
++ { WM8994_RIGHT_OUTPUT_VOLUME, WM8994_HPOUT1_VU }, |
3193 |
++ { WM8994_LEFT_OPGA_VOLUME, WM8994_MIXOUT_VU }, |
3194 |
++ { WM8994_RIGHT_OPGA_VOLUME, WM8994_MIXOUT_VU }, |
3195 |
++ |
3196 |
++ { WM8994_AIF1_DAC1_LEFT_VOLUME, WM8994_AIF1DAC1_VU }, |
3197 |
++ { WM8994_AIF1_DAC1_RIGHT_VOLUME, WM8994_AIF1DAC1_VU }, |
3198 |
++ { WM8994_AIF1_DAC2_LEFT_VOLUME, WM8994_AIF1DAC2_VU }, |
3199 |
++ { WM8994_AIF1_DAC2_RIGHT_VOLUME, WM8994_AIF1DAC2_VU }, |
3200 |
++ { WM8994_AIF2_DAC_LEFT_VOLUME, WM8994_AIF2DAC_VU }, |
3201 |
++ { WM8994_AIF2_DAC_RIGHT_VOLUME, WM8994_AIF2DAC_VU }, |
3202 |
++ { WM8994_AIF1_ADC1_LEFT_VOLUME, WM8994_AIF1ADC1_VU }, |
3203 |
++ { WM8994_AIF1_ADC1_RIGHT_VOLUME, WM8994_AIF1ADC1_VU }, |
3204 |
++ { WM8994_AIF1_ADC2_LEFT_VOLUME, WM8994_AIF1ADC2_VU }, |
3205 |
++ { WM8994_AIF1_ADC2_RIGHT_VOLUME, WM8994_AIF1ADC2_VU }, |
3206 |
++ { WM8994_AIF2_ADC_LEFT_VOLUME, WM8994_AIF2ADC_VU }, |
3207 |
++ { WM8994_AIF2_ADC_RIGHT_VOLUME, WM8994_AIF1ADC2_VU }, |
3208 |
++ { WM8994_DAC1_LEFT_VOLUME, WM8994_DAC1_VU }, |
3209 |
++ { WM8994_DAC1_RIGHT_VOLUME, WM8994_DAC1_VU }, |
3210 |
++ { WM8994_DAC2_LEFT_VOLUME, WM8994_DAC2_VU }, |
3211 |
++ { WM8994_DAC2_RIGHT_VOLUME, WM8994_DAC2_VU }, |
3212 |
++}; |
3213 |
++ |
3214 |
+ static int wm8994_drc_base[] = { |
3215 |
+ WM8994_AIF1_DRC1_1, |
3216 |
+ WM8994_AIF1_DRC2_1, |
3217 |
+@@ -1006,6 +1039,7 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w, |
3218 |
+ struct snd_soc_codec *codec = w->codec; |
3219 |
+ struct wm8994 *control = codec->control_data; |
3220 |
+ int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; |
3221 |
++ int i; |
3222 |
+ int dac; |
3223 |
+ int adc; |
3224 |
+ int val; |
3225 |
+@@ -1064,6 +1098,13 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w, |
3226 |
+ WM8994_AIF1DAC2L_ENA); |
3227 |
+ break; |
3228 |
+ |
3229 |
++ case SND_SOC_DAPM_POST_PMU: |
3230 |
++ for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++) |
3231 |
++ snd_soc_write(codec, wm8994_vu_bits[i].reg, |
3232 |
++ snd_soc_read(codec, |
3233 |
++ wm8994_vu_bits[i].reg)); |
3234 |
++ break; |
3235 |
++ |
3236 |
+ case SND_SOC_DAPM_PRE_PMD: |
3237 |
+ case SND_SOC_DAPM_POST_PMD: |
3238 |
+ snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, |
3239 |
+@@ -1089,6 +1130,7 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w, |
3240 |
+ struct snd_kcontrol *kcontrol, int event) |
3241 |
+ { |
3242 |
+ struct snd_soc_codec *codec = w->codec; |
3243 |
++ int i; |
3244 |
+ int dac; |
3245 |
+ int adc; |
3246 |
+ int val; |
3247 |
+@@ -1139,6 +1181,13 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w, |
3248 |
+ WM8994_AIF2DACR_ENA); |
3249 |
+ break; |
3250 |
+ |
3251 |
++ case SND_SOC_DAPM_POST_PMU: |
3252 |
++ for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++) |
3253 |
++ snd_soc_write(codec, wm8994_vu_bits[i].reg, |
3254 |
++ snd_soc_read(codec, |
3255 |
++ wm8994_vu_bits[i].reg)); |
3256 |
++ break; |
3257 |
++ |
3258 |
+ case SND_SOC_DAPM_PRE_PMD: |
3259 |
+ case SND_SOC_DAPM_POST_PMD: |
3260 |
+ snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, |
3261 |
+@@ -1207,17 +1256,19 @@ static int late_enable_ev(struct snd_soc_dapm_widget *w, |
3262 |
+ switch (event) { |
3263 |
+ case SND_SOC_DAPM_PRE_PMU: |
3264 |
+ if (wm8994->aif1clk_enable) { |
3265 |
+- aif1clk_ev(w, kcontrol, event); |
3266 |
++ aif1clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMU); |
3267 |
+ snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, |
3268 |
+ WM8994_AIF1CLK_ENA_MASK, |
3269 |
+ WM8994_AIF1CLK_ENA); |
3270 |
++ aif1clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMU); |
3271 |
+ wm8994->aif1clk_enable = 0; |
3272 |
+ } |
3273 |
+ if (wm8994->aif2clk_enable) { |
3274 |
+- aif2clk_ev(w, kcontrol, event); |
3275 |
++ aif2clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMU); |
3276 |
+ snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, |
3277 |
+ WM8994_AIF2CLK_ENA_MASK, |
3278 |
+ WM8994_AIF2CLK_ENA); |
3279 |
++ aif2clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMU); |
3280 |
+ wm8994->aif2clk_enable = 0; |
3281 |
+ } |
3282 |
+ break; |
3283 |
+@@ -1238,15 +1289,17 @@ static int late_disable_ev(struct snd_soc_dapm_widget *w, |
3284 |
+ switch (event) { |
3285 |
+ case SND_SOC_DAPM_POST_PMD: |
3286 |
+ if (wm8994->aif1clk_disable) { |
3287 |
++ aif1clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMD); |
3288 |
+ snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, |
3289 |
+ WM8994_AIF1CLK_ENA_MASK, 0); |
3290 |
+- aif1clk_ev(w, kcontrol, event); |
3291 |
++ aif1clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMD); |
3292 |
+ wm8994->aif1clk_disable = 0; |
3293 |
+ } |
3294 |
+ if (wm8994->aif2clk_disable) { |
3295 |
++ aif2clk_ev(w, kcontrol, SND_SOC_DAPM_PRE_PMD); |
3296 |
+ snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, |
3297 |
+ WM8994_AIF2CLK_ENA_MASK, 0); |
3298 |
+- aif2clk_ev(w, kcontrol, event); |
3299 |
++ aif2clk_ev(w, kcontrol, SND_SOC_DAPM_POST_PMD); |
3300 |
+ wm8994->aif2clk_disable = 0; |
3301 |
+ } |
3302 |
+ break; |
3303 |
+@@ -1583,9 +1636,11 @@ SND_SOC_DAPM_POST("Late Disable PGA", late_disable_ev) |
3304 |
+ |
3305 |
+ static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { |
3306 |
+ SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, aif1clk_ev, |
3307 |
+- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD), |
3308 |
++ SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
3309 |
++ SND_SOC_DAPM_PRE_PMD), |
3310 |
+ SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, aif2clk_ev, |
3311 |
+- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD), |
3312 |
++ SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
3313 |
++ SND_SOC_DAPM_PRE_PMD), |
3314 |
+ SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0), |
3315 |
+ SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0, |
3316 |
+ left_speaker_mixer, ARRAY_SIZE(left_speaker_mixer)), |
3317 |
+@@ -3939,39 +3994,11 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) |
3318 |
+ |
3319 |
+ pm_runtime_put(codec->dev); |
3320 |
+ |
3321 |
+- /* Latch volume updates (right only; we always do left then right). */ |
3322 |
+- snd_soc_update_bits(codec, WM8994_AIF1_DAC1_LEFT_VOLUME, |
3323 |
+- WM8994_AIF1DAC1_VU, WM8994_AIF1DAC1_VU); |
3324 |
+- snd_soc_update_bits(codec, WM8994_AIF1_DAC1_RIGHT_VOLUME, |
3325 |
+- WM8994_AIF1DAC1_VU, WM8994_AIF1DAC1_VU); |
3326 |
+- snd_soc_update_bits(codec, WM8994_AIF1_DAC2_LEFT_VOLUME, |
3327 |
+- WM8994_AIF1DAC2_VU, WM8994_AIF1DAC2_VU); |
3328 |
+- snd_soc_update_bits(codec, WM8994_AIF1_DAC2_RIGHT_VOLUME, |
3329 |
+- WM8994_AIF1DAC2_VU, WM8994_AIF1DAC2_VU); |
3330 |
+- snd_soc_update_bits(codec, WM8994_AIF2_DAC_LEFT_VOLUME, |
3331 |
+- WM8994_AIF2DAC_VU, WM8994_AIF2DAC_VU); |
3332 |
+- snd_soc_update_bits(codec, WM8994_AIF2_DAC_RIGHT_VOLUME, |
3333 |
+- WM8994_AIF2DAC_VU, WM8994_AIF2DAC_VU); |
3334 |
+- snd_soc_update_bits(codec, WM8994_AIF1_ADC1_LEFT_VOLUME, |
3335 |
+- WM8994_AIF1ADC1_VU, WM8994_AIF1ADC1_VU); |
3336 |
+- snd_soc_update_bits(codec, WM8994_AIF1_ADC1_RIGHT_VOLUME, |
3337 |
+- WM8994_AIF1ADC1_VU, WM8994_AIF1ADC1_VU); |
3338 |
+- snd_soc_update_bits(codec, WM8994_AIF1_ADC2_LEFT_VOLUME, |
3339 |
+- WM8994_AIF1ADC2_VU, WM8994_AIF1ADC2_VU); |
3340 |
+- snd_soc_update_bits(codec, WM8994_AIF1_ADC2_RIGHT_VOLUME, |
3341 |
+- WM8994_AIF1ADC2_VU, WM8994_AIF1ADC2_VU); |
3342 |
+- snd_soc_update_bits(codec, WM8994_AIF2_ADC_LEFT_VOLUME, |
3343 |
+- WM8994_AIF2ADC_VU, WM8994_AIF1ADC2_VU); |
3344 |
+- snd_soc_update_bits(codec, WM8994_AIF2_ADC_RIGHT_VOLUME, |
3345 |
+- WM8994_AIF2ADC_VU, WM8994_AIF1ADC2_VU); |
3346 |
+- snd_soc_update_bits(codec, WM8994_DAC1_LEFT_VOLUME, |
3347 |
+- WM8994_DAC1_VU, WM8994_DAC1_VU); |
3348 |
+- snd_soc_update_bits(codec, WM8994_DAC1_RIGHT_VOLUME, |
3349 |
+- WM8994_DAC1_VU, WM8994_DAC1_VU); |
3350 |
+- snd_soc_update_bits(codec, WM8994_DAC2_LEFT_VOLUME, |
3351 |
+- WM8994_DAC2_VU, WM8994_DAC2_VU); |
3352 |
+- snd_soc_update_bits(codec, WM8994_DAC2_RIGHT_VOLUME, |
3353 |
+- WM8994_DAC2_VU, WM8994_DAC2_VU); |
3354 |
++ /* Latch volume update bits */ |
3355 |
++ for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++) |
3356 |
++ snd_soc_update_bits(codec, wm8994_vu_bits[i].reg, |
3357 |
++ wm8994_vu_bits[i].mask, |
3358 |
++ wm8994_vu_bits[i].mask); |
3359 |
+ |
3360 |
+ /* Set the low bit of the 3D stereo depth so TLV matches */ |
3361 |
+ snd_soc_update_bits(codec, WM8994_AIF1_DAC1_FILTERS_2, |
3362 |
|
3363 |
diff --git a/3.4.2/4420_grsecurity-2.9.1-3.4.2-201206160836.patch b/3.4.3/4420_grsecurity-2.9.1-3.4.3-201206171836.patch |
3364 |
similarity index 99% |
3365 |
rename from 3.4.2/4420_grsecurity-2.9.1-3.4.2-201206160836.patch |
3366 |
rename to 3.4.3/4420_grsecurity-2.9.1-3.4.3-201206171836.patch |
3367 |
index 7ce88db..57ad302 100644 |
3368 |
--- a/3.4.2/4420_grsecurity-2.9.1-3.4.2-201206160836.patch |
3369 |
+++ b/3.4.3/4420_grsecurity-2.9.1-3.4.3-201206171836.patch |
3370 |
@@ -227,7 +227,7 @@ index c1601e5..08557ce 100644 |
3371 |
|
3372 |
pcd. [PARIDE] |
3373 |
diff --git a/Makefile b/Makefile |
3374 |
-index 901a955..dbc701b 100644 |
3375 |
+index a0804c6..f487027 100644 |
3376 |
--- a/Makefile |
3377 |
+++ b/Makefile |
3378 |
@@ -245,8 +245,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
3379 |
@@ -4147,7 +4147,7 @@ index 8f880bc..c5bd2f3 100644 |
3380 |
addi r3,r1,STACK_FRAME_OVERHEAD |
3381 |
lwz r4,_DAR(r1) |
3382 |
diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c |
3383 |
-index 0b6d796..d760ddb 100644 |
3384 |
+index 2e3200c..72095ce 100644 |
3385 |
--- a/arch/powerpc/kernel/module_32.c |
3386 |
+++ b/arch/powerpc/kernel/module_32.c |
3387 |
@@ -162,7 +162,7 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr, |
3388 |
@@ -8070,7 +8070,7 @@ index 5b577d5..3c1fed4 100644 |
3389 |
movq r1,r2; \ |
3390 |
movq r3,r4; \ |
3391 |
diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S |
3392 |
-index be6d9e3..21fbbca 100644 |
3393 |
+index 3470624..201259d 100644 |
3394 |
--- a/arch/x86/crypto/aesni-intel_asm.S |
3395 |
+++ b/arch/x86/crypto/aesni-intel_asm.S |
3396 |
@@ -31,6 +31,7 @@ |
3397 |
@@ -8225,7 +8225,7 @@ index be6d9e3..21fbbca 100644 |
3398 |
|
3399 |
/* |
3400 |
* void aesni_cbc_dec(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src, |
3401 |
-@@ -2498,7 +2523,9 @@ ENTRY(aesni_cbc_dec) |
3402 |
+@@ -2500,7 +2525,9 @@ ENTRY(aesni_cbc_dec) |
3403 |
popl LEN |
3404 |
popl IVP |
3405 |
#endif |
3406 |
@@ -8235,7 +8235,7 @@ index be6d9e3..21fbbca 100644 |
3407 |
|
3408 |
#ifdef __x86_64__ |
3409 |
.align 16 |
3410 |
-@@ -2524,6 +2551,7 @@ _aesni_inc_init: |
3411 |
+@@ -2526,6 +2553,7 @@ _aesni_inc_init: |
3412 |
mov $1, TCTR_LOW |
3413 |
MOVQ_R64_XMM TCTR_LOW INC |
3414 |
MOVQ_R64_XMM CTR TCTR_LOW |
3415 |
@@ -8243,7 +8243,7 @@ index be6d9e3..21fbbca 100644 |
3416 |
ret |
3417 |
|
3418 |
/* |
3419 |
-@@ -2552,6 +2580,7 @@ _aesni_inc: |
3420 |
+@@ -2554,6 +2582,7 @@ _aesni_inc: |
3421 |
.Linc_low: |
3422 |
movaps CTR, IV |
3423 |
PSHUFB_XMM BSWAP_MASK IV |
3424 |
@@ -8251,7 +8251,7 @@ index be6d9e3..21fbbca 100644 |
3425 |
ret |
3426 |
|
3427 |
/* |
3428 |
-@@ -2612,5 +2641,7 @@ ENTRY(aesni_ctr_enc) |
3429 |
+@@ -2614,5 +2643,7 @@ ENTRY(aesni_ctr_enc) |
3430 |
.Lctr_enc_ret: |
3431 |
movups IV, (IVP) |
3432 |
.Lctr_enc_just_ret: |
3433 |
@@ -27650,10 +27650,10 @@ index 0734086..3ad3e4c 100644 |
3434 |
/* |
3435 |
* Buggy BIOS check |
3436 |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c |
3437 |
-index 23763a1..6375e67 100644 |
3438 |
+index d31ee55..8363a8b 100644 |
3439 |
--- a/drivers/ata/libata-core.c |
3440 |
+++ b/drivers/ata/libata-core.c |
3441 |
-@@ -4736,7 +4736,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) |
3442 |
+@@ -4742,7 +4742,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) |
3443 |
struct ata_port *ap; |
3444 |
unsigned int tag; |
3445 |
|
3446 |
@@ -27662,7 +27662,7 @@ index 23763a1..6375e67 100644 |
3447 |
ap = qc->ap; |
3448 |
|
3449 |
qc->flags = 0; |
3450 |
-@@ -4752,7 +4752,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) |
3451 |
+@@ -4758,7 +4758,7 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) |
3452 |
struct ata_port *ap; |
3453 |
struct ata_link *link; |
3454 |
|
3455 |
@@ -27671,7 +27671,7 @@ index 23763a1..6375e67 100644 |
3456 |
WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); |
3457 |
ap = qc->ap; |
3458 |
link = qc->dev->link; |
3459 |
-@@ -5816,6 +5816,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) |
3460 |
+@@ -5822,6 +5822,7 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) |
3461 |
return; |
3462 |
|
3463 |
spin_lock(&lock); |
3464 |
@@ -27679,7 +27679,7 @@ index 23763a1..6375e67 100644 |
3465 |
|
3466 |
for (cur = ops->inherits; cur; cur = cur->inherits) { |
3467 |
void **inherit = (void **)cur; |
3468 |
-@@ -5829,8 +5830,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) |
3469 |
+@@ -5835,8 +5836,9 @@ static void ata_finalize_port_ops(struct ata_port_operations *ops) |
3470 |
if (IS_ERR(*pp)) |
3471 |
*pp = NULL; |
3472 |
|
3473 |
@@ -42519,10 +42519,10 @@ index 4106264..8157ede 100644 |
3474 |
|
3475 |
WARN_ON(trans->transid != btrfs_header_generation(parent)); |
3476 |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c |
3477 |
-index 61b16c6..b492c09 100644 |
3478 |
+index 0df0d1f..4bdcbfe 100644 |
3479 |
--- a/fs/btrfs/inode.c |
3480 |
+++ b/fs/btrfs/inode.c |
3481 |
-@@ -7071,7 +7071,7 @@ fail: |
3482 |
+@@ -7074,7 +7074,7 @@ fail: |
3483 |
return -ENOMEM; |
3484 |
} |
3485 |
|
3486 |
@@ -42531,7 +42531,7 @@ index 61b16c6..b492c09 100644 |
3487 |
struct dentry *dentry, struct kstat *stat) |
3488 |
{ |
3489 |
struct inode *inode = dentry->d_inode; |
3490 |
-@@ -7085,6 +7085,14 @@ static int btrfs_getattr(struct vfsmount *mnt, |
3491 |
+@@ -7088,6 +7088,14 @@ static int btrfs_getattr(struct vfsmount *mnt, |
3492 |
return 0; |
3493 |
} |
3494 |
|
3495 |
@@ -44186,7 +44186,7 @@ index baac1b1..1499b62 100644 |
3496 |
} |
3497 |
return 1; |
3498 |
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c |
3499 |
-index 4bbd07a..a37bee6 100644 |
3500 |
+index 8da837b..ed3835b 100644 |
3501 |
--- a/fs/ext4/balloc.c |
3502 |
+++ b/fs/ext4/balloc.c |
3503 |
@@ -463,8 +463,8 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi, |
3504 |
@@ -45963,10 +45963,10 @@ index 7df2b5e..5804aa7 100644 |
3505 |
if (!ret) |
3506 |
ret = -EPIPE; |
3507 |
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c |
3508 |
-index df5ac04..08cee2a 100644 |
3509 |
+index bc43832..0cfe5a6 100644 |
3510 |
--- a/fs/fuse/dir.c |
3511 |
+++ b/fs/fuse/dir.c |
3512 |
-@@ -1180,7 +1180,7 @@ static char *read_link(struct dentry *dentry) |
3513 |
+@@ -1181,7 +1181,7 @@ static char *read_link(struct dentry *dentry) |
3514 |
return link; |
3515 |
} |
3516 |
|
3517 |
@@ -61522,10 +61522,10 @@ index 72cbf08..dd0201d 100644 |
3518 |
|
3519 |
int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu); |
3520 |
diff --git a/include/linux/libata.h b/include/linux/libata.h |
3521 |
-index e926df7..1713bd8 100644 |
3522 |
+index 6e887c7..4539601 100644 |
3523 |
--- a/include/linux/libata.h |
3524 |
+++ b/include/linux/libata.h |
3525 |
-@@ -909,7 +909,7 @@ struct ata_port_operations { |
3526 |
+@@ -910,7 +910,7 @@ struct ata_port_operations { |
3527 |
* fields must be pointers. |
3528 |
*/ |
3529 |
const struct ata_port_operations *inherits; |
3530 |
@@ -61997,7 +61997,7 @@ index b2be02e..72d2f78 100644 |
3531 |
or 0. */ |
3532 |
int apply_relocate(Elf_Shdr *sechdrs, |
3533 |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h |
3534 |
-index ea36486..91e70f4 100644 |
3535 |
+index 944bc18..042d291 100644 |
3536 |
--- a/include/linux/moduleparam.h |
3537 |
+++ b/include/linux/moduleparam.h |
3538 |
@@ -286,7 +286,7 @@ static inline void __kernel_param_unlock(void) |
3539 |
@@ -64257,7 +64257,7 @@ index 8216c30..25e8e32 100644 |
3540 |
next_state = Reset; |
3541 |
return 0; |
3542 |
diff --git a/init/main.c b/init/main.c |
3543 |
-index cb54cd3..8773e3c 100644 |
3544 |
+index b08c5f7..09f865e 100644 |
3545 |
--- a/init/main.c |
3546 |
+++ b/init/main.c |
3547 |
@@ -95,6 +95,8 @@ static inline void mark_rodata_ro(void) { } |
3548 |
@@ -67912,7 +67912,7 @@ index 0984a21..939f183 100644 |
3549 |
#ifdef CONFIG_RT_GROUP_SCHED |
3550 |
/* |
3551 |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c |
3552 |
-index e5212ae..2fcf98d 100644 |
3553 |
+index 2000e06..79cf3d8 100644 |
3554 |
--- a/kernel/sched/core.c |
3555 |
+++ b/kernel/sched/core.c |
3556 |
@@ -3907,6 +3907,8 @@ int can_nice(const struct task_struct *p, const int nice) |
3557 |
@@ -68671,7 +68671,7 @@ index f113755..ec24223 100644 |
3558 |
cpumask_clear_cpu(cpu, tick_get_broadcast_mask()); |
3559 |
tick_broadcast_clear_oneshot(cpu); |
3560 |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c |
3561 |
-index d66b213..6947686 100644 |
3562 |
+index d42574df..247414c 100644 |
3563 |
--- a/kernel/time/timekeeping.c |
3564 |
+++ b/kernel/time/timekeeping.c |
3565 |
@@ -14,6 +14,7 @@ |
3566 |
@@ -75525,7 +75525,7 @@ index db8fae5..ff070cd 100644 |
3567 |
/* number of interfaces with corresponding FIF_ flags */ |
3568 |
int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll, |
3569 |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c |
3570 |
-index c20051b..2accbc4 100644 |
3571 |
+index 48f937e..4ccd7b8 100644 |
3572 |
--- a/net/mac80211/iface.c |
3573 |
+++ b/net/mac80211/iface.c |
3574 |
@@ -222,7 +222,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) |
3575 |
@@ -75573,7 +75573,7 @@ index c20051b..2accbc4 100644 |
3576 |
|
3577 |
switch (sdata->vif.type) { |
3578 |
case NL80211_IFTYPE_AP_VLAN: |
3579 |
-@@ -550,7 +550,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, |
3580 |
+@@ -562,7 +562,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, |
3581 |
|
3582 |
ieee80211_recalc_ps(local, -1); |
3583 |
|
3584 |
@@ -75653,7 +75653,7 @@ index c97a065..ff61928 100644 |
3585 |
|
3586 |
return p; |
3587 |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c |
3588 |
-index 3862c96..3258ddc 100644 |
3589 |
+index eb9d7c0..d34b832 100644 |
3590 |
--- a/net/mac80211/util.c |
3591 |
+++ b/net/mac80211/util.c |
3592 |
@@ -1179,7 +1179,7 @@ int ieee80211_reconfig(struct ieee80211_local *local) |
3593 |
@@ -97776,10 +97776,10 @@ index 0000000..c2eca90 |
3594 |
+}; |
3595 |
diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c |
3596 |
new file mode 100644 |
3597 |
-index 0000000..64846cb |
3598 |
+index 0000000..273e66a |
3599 |
--- /dev/null |
3600 |
+++ b/tools/gcc/size_overflow_plugin.c |
3601 |
-@@ -0,0 +1,1224 @@ |
3602 |
+@@ -0,0 +1,1203 @@ |
3603 |
+/* |
3604 |
+ * Copyright 2011, 2012 by Emese Revfy <re.emese@×××××.com> |
3605 |
+ * Licensed under the GPL v2, or (at your option) v3 |
3606 |
@@ -97792,7 +97792,7 @@ index 0000000..64846cb |
3607 |
+ * The recomputed argument is checked against TYPE_MAX and an event is logged on overflow and the triggering process is killed. |
3608 |
+ * |
3609 |
+ * Usage: |
3610 |
-+ * $ gcc -I`gcc -print-file-name=plugin`/include -fPIC -shared -O2 -o size_overflow_plugin.so size_overflow_plugin.c |
3611 |
++ * $ gcc -I`gcc -print-file-name=plugin`/include/c-family -I`gcc -print-file-name=plugin`/include -fPIC -shared -O2 -ggdb -Wall -W -Wno-missing-field-initializers -o size_overflow_plugin.so size_overflow_plugin.c |
3612 |
+ * $ gcc -fplugin=size_overflow_plugin.so test.c -O2 |
3613 |
+ */ |
3614 |
+ |
3615 |
@@ -97846,8 +97846,8 @@ index 0000000..64846cb |
3616 |
+static unsigned int handle_function(void); |
3617 |
+ |
3618 |
+static struct plugin_info size_overflow_plugin_info = { |
3619 |
-+ .version = "20120612beta", |
3620 |
-+ .help = "no-size_overflow\tturn off size overflow checking\n", |
3621 |
++ .version = "20120617beta", |
3622 |
++ .help = "no-size-overflow\tturn off size overflow checking\n", |
3623 |
+}; |
3624 |
+ |
3625 |
+static tree handle_size_overflow_attribute(tree *node, tree __unused name, tree args, int __unused flags, bool *no_add_attrs) |
3626 |
@@ -97871,7 +97871,7 @@ index 0000000..64846cb |
3627 |
+ .decl_required = false, |
3628 |
+ .type_required = true, |
3629 |
+ .function_type_required = true, |
3630 |
-+ .handler = handle_size_overflow_attribute, |
3631 |
++ .handler = handle_size_overflow_attribute |
3632 |
+#if BUILDING_GCC_VERSION >= 4007 |
3633 |
+ .affects_type_identity = false |
3634 |
+#endif |
3635 |
@@ -98135,11 +98135,17 @@ index 0000000..64846cb |
3636 |
+ |
3637 |
+static tree cast_a_tree(tree type, tree var) |
3638 |
+{ |
3639 |
++ gcc_assert(type != NULL_TREE && var != NULL_TREE); |
3640 |
+ gcc_assert(fold_convertible_p(type, var)); |
3641 |
+ |
3642 |
+ return fold_convert(type, var); |
3643 |
+} |
3644 |
+ |
3645 |
++static tree signed_cast(tree var) |
3646 |
++{ |
3647 |
++ return cast_a_tree(signed_size_overflow_type, var); |
3648 |
++} |
3649 |
++ |
3650 |
+static gimple build_cast_stmt(tree type, tree var, tree new_var, location_t loc) |
3651 |
+{ |
3652 |
+ gimple assign; |
3653 |
@@ -98238,7 +98244,7 @@ index 0000000..64846cb |
3654 |
+ |
3655 |
+ if (rhs1 != NULL_TREE) { |
3656 |
+ if (!gimple_assign_cast_p(oldstmt)) |
3657 |
-+ rhs1 = cast_a_tree(signed_size_overflow_type, rhs1); |
3658 |
++ rhs1 = signed_cast(rhs1); |
3659 |
+ gimple_assign_set_rhs1(stmt, rhs1); |
3660 |
+ } |
3661 |
+ |
3662 |
@@ -98276,13 +98282,6 @@ index 0000000..64846cb |
3663 |
+ return phi; |
3664 |
+} |
3665 |
+ |
3666 |
-+static tree signed_cast_constant(tree node) |
3667 |
-+{ |
3668 |
-+ gcc_assert(is_gimple_constant(node)); |
3669 |
-+ |
3670 |
-+ return cast_a_tree(signed_size_overflow_type, node); |
3671 |
-+} |
3672 |
-+ |
3673 |
+static basic_block create_a_first_bb(void) |
3674 |
+{ |
3675 |
+ basic_block first_bb; |
3676 |
@@ -98378,7 +98377,7 @@ index 0000000..64846cb |
3677 |
+ |
3678 |
+ arg = gimple_phi_arg_def(oldstmt, i); |
3679 |
+ if (is_gimple_constant(arg)) |
3680 |
-+ arg = signed_cast_constant(arg); |
3681 |
++ arg = signed_cast(arg); |
3682 |
+ lhs = build_new_phi_arg(visited, potentionally_overflowed, arg, new_var); |
3683 |
+ if (lhs == NULL_TREE) |
3684 |
+ lhs = gimple_get_lhs(cast_old_phi_arg(oldstmt, arg, new_var, i)); |
3685 |
@@ -98411,7 +98410,7 @@ index 0000000..64846cb |
3686 |
+ tree rhs1 = gimple_assign_rhs1(def_stmt); |
3687 |
+ |
3688 |
+ if (is_gimple_constant(rhs1)) |
3689 |
-+ return dup_assign(visited, potentionally_overflowed, def_stmt, signed_cast_constant(rhs1), NULL_TREE, NULL_TREE); |
3690 |
++ return dup_assign(visited, potentionally_overflowed, def_stmt, signed_cast(rhs1), NULL_TREE, NULL_TREE); |
3691 |
+ |
3692 |
+ gcc_assert(TREE_CODE(rhs1) != COND_EXPR); |
3693 |
+ switch (TREE_CODE(rhs1)) { |
3694 |
@@ -98540,19 +98539,6 @@ index 0000000..64846cb |
3695 |
+// print_the_code_insertions(stmt); |
3696 |
+} |
3697 |
+ |
3698 |
-+static tree get_type_for_check(tree rhs) |
3699 |
-+{ |
3700 |
-+ tree def_rhs; |
3701 |
-+ gimple def_stmt = get_def_stmt(rhs); |
3702 |
-+ |
3703 |
-+ if (!gimple_assign_cast_p(def_stmt)) |
3704 |
-+ return TREE_TYPE(rhs); |
3705 |
-+ def_rhs = gimple_assign_rhs1(def_stmt); |
3706 |
-+ if (TREE_CODE(TREE_TYPE(def_rhs)) == INTEGER_TYPE) |
3707 |
-+ return TREE_TYPE(def_rhs); |
3708 |
-+ return TREE_TYPE(rhs); |
3709 |
-+} |
3710 |
-+ |
3711 |
+static gimple cast_to_unsigned_size_overflow_type(gimple stmt, tree cast_rhs) |
3712 |
+{ |
3713 |
+ gimple ucast_stmt; |
3714 |
@@ -98567,61 +98553,54 @@ index 0000000..64846cb |
3715 |
+ |
3716 |
+static void check_size_overflow(gimple stmt, tree cast_rhs, tree rhs, bool *potentionally_overflowed) |
3717 |
+{ |
3718 |
-+ tree type_max, type_min, rhs_type; |
3719 |
++ tree type_max, type_min, rhs_type = TREE_TYPE(rhs); |
3720 |
+ gimple ucast_stmt; |
3721 |
+ |
3722 |
+ if (!*potentionally_overflowed) |
3723 |
+ return; |
3724 |
+ |
3725 |
-+ rhs_type = get_type_for_check(rhs); |
3726 |
-+ |
3727 |
+ if (TYPE_UNSIGNED(rhs_type)) { |
3728 |
+ ucast_stmt = cast_to_unsigned_size_overflow_type(stmt, cast_rhs); |
3729 |
+ type_max = cast_a_tree(unsigned_size_overflow_type, TYPE_MAX_VALUE(rhs_type)); |
3730 |
+ insert_check_size_overflow(stmt, GT_EXPR, gimple_get_lhs(ucast_stmt), type_max); |
3731 |
+ } else { |
3732 |
-+ type_max = cast_a_tree(signed_size_overflow_type, TYPE_MAX_VALUE(rhs_type)); |
3733 |
++ type_max = signed_cast(TYPE_MAX_VALUE(rhs_type)); |
3734 |
+ insert_check_size_overflow(stmt, GT_EXPR, cast_rhs, type_max); |
3735 |
+ |
3736 |
-+ type_min = cast_a_tree(signed_size_overflow_type, TYPE_MIN_VALUE(rhs_type)); |
3737 |
++ type_min = signed_cast(TYPE_MIN_VALUE(rhs_type)); |
3738 |
+ insert_check_size_overflow(stmt, LT_EXPR, cast_rhs, type_min); |
3739 |
+ } |
3740 |
+} |
3741 |
+ |
3742 |
-+static tree change_assign_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple stmt, tree orig_rhs) |
3743 |
++static tree change_assign_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple stmt, tree orig_rhs, tree new_rhs) |
3744 |
+{ |
3745 |
+ gimple assign; |
3746 |
+ gimple_stmt_iterator gsi = gsi_for_stmt(stmt); |
3747 |
-+ tree new_rhs, origtype = TREE_TYPE(orig_rhs); |
3748 |
++ tree origtype = TREE_TYPE(orig_rhs); |
3749 |
+ |
3750 |
+ gcc_assert(gimple_code(stmt) == GIMPLE_ASSIGN); |
3751 |
+ |
3752 |
-+ new_rhs = expand(visited, potentionally_overflowed, orig_rhs); |
3753 |
-+ if (new_rhs == NULL_TREE) |
3754 |
-+ return NULL_TREE; |
3755 |
-+ |
3756 |
+ assign = build_cast_stmt(origtype, new_rhs, CREATE_NEW_VAR, gimple_location(stmt)); |
3757 |
+ gsi_insert_before(&gsi, assign, GSI_SAME_STMT); |
3758 |
+ update_stmt(assign); |
3759 |
+ return gimple_get_lhs(assign); |
3760 |
+} |
3761 |
+ |
3762 |
-+static tree handle_const_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple def_stmt, tree var, tree rhs, tree new_rhs1, tree new_rhs2, void (*gimple_assign_set_rhs)(gimple, tree)) |
3763 |
++static tree handle_const_assign(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple def_stmt, tree var, tree orig_rhs, tree var_rhs, tree new_rhs1, tree new_rhs2, void (*gimple_assign_set_rhs)(gimple, tree)) |
3764 |
+{ |
3765 |
-+ tree new_rhs, cast_rhs; |
3766 |
++ tree new_rhs; |
3767 |
+ |
3768 |
+ if (gimple_assign_rhs_code(def_stmt) == MIN_EXPR) |
3769 |
+ return dup_assign(visited, potentionally_overflowed, def_stmt, new_rhs1, new_rhs2, NULL_TREE); |
3770 |
+ |
3771 |
-+ new_rhs = change_assign_rhs(visited, potentionally_overflowed, def_stmt, rhs); |
3772 |
-+ if (new_rhs != NULL_TREE) { |
3773 |
-+ gimple_assign_set_rhs(def_stmt, new_rhs); |
3774 |
-+ update_stmt(def_stmt); |
3775 |
++ if (var_rhs == NULL_TREE) |
3776 |
++ return create_assign(visited, potentionally_overflowed, def_stmt, var, AFTER_STMT); |
3777 |
+ |
3778 |
-+ cast_rhs = gimple_assign_rhs1(get_def_stmt(new_rhs)); |
3779 |
++ new_rhs = change_assign_rhs(visited, potentionally_overflowed, def_stmt, orig_rhs, var_rhs); |
3780 |
++ gimple_assign_set_rhs(def_stmt, new_rhs); |
3781 |
++ update_stmt(def_stmt); |
3782 |
+ |
3783 |
-+ check_size_overflow(def_stmt, cast_rhs, rhs, potentionally_overflowed); |
3784 |
-+ } |
3785 |
++ check_size_overflow(def_stmt, var_rhs, orig_rhs, potentionally_overflowed); |
3786 |
+ return create_assign(visited, potentionally_overflowed, def_stmt, var, AFTER_STMT); |
3787 |
+} |
3788 |
+ |
3789 |
@@ -98662,10 +98641,10 @@ index 0000000..64846cb |
3790 |
+ new_rhs2 = expand(visited, potentionally_overflowed, rhs2); |
3791 |
+ |
3792 |
+ if (is_gimple_constant(rhs2)) |
3793 |
-+ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs1, new_rhs1, signed_cast_constant(rhs2), &gimple_assign_set_rhs1); |
3794 |
++ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs1, new_rhs1, new_rhs1, signed_cast(rhs2), &gimple_assign_set_rhs1); |
3795 |
+ |
3796 |
+ if (is_gimple_constant(rhs1)) |
3797 |
-+ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs2, signed_cast_constant(rhs1), new_rhs2, &gimple_assign_set_rhs2); |
3798 |
++ return handle_const_assign(visited, potentionally_overflowed, def_stmt, var, rhs2, new_rhs2, signed_cast(rhs1), new_rhs2, &gimple_assign_set_rhs2); |
3799 |
+ |
3800 |
+ return dup_assign(visited, potentionally_overflowed, def_stmt, new_rhs1, new_rhs2, NULL_TREE); |
3801 |
+} |
3802 |
@@ -98674,7 +98653,7 @@ index 0000000..64846cb |
3803 |
+static tree get_new_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, tree rhs) |
3804 |
+{ |
3805 |
+ if (is_gimple_constant(rhs)) |
3806 |
-+ return signed_cast_constant(rhs); |
3807 |
++ return signed_cast(rhs); |
3808 |
+ if (TREE_CODE(rhs) != SSA_NAME) |
3809 |
+ return NULL_TREE; |
3810 |
+ return expand(visited, potentionally_overflowed, rhs); |
3811 |
|
3812 |
diff --git a/3.4.2/4430_grsec-remove-localversion-grsec.patch b/3.4.3/4430_grsec-remove-localversion-grsec.patch |
3813 |
similarity index 100% |
3814 |
rename from 3.4.2/4430_grsec-remove-localversion-grsec.patch |
3815 |
rename to 3.4.3/4430_grsec-remove-localversion-grsec.patch |
3816 |
|
3817 |
diff --git a/3.4.2/4435_grsec-mute-warnings.patch b/3.4.3/4435_grsec-mute-warnings.patch |
3818 |
similarity index 100% |
3819 |
rename from 3.4.2/4435_grsec-mute-warnings.patch |
3820 |
rename to 3.4.3/4435_grsec-mute-warnings.patch |
3821 |
|
3822 |
diff --git a/3.4.2/4440_grsec-remove-protected-paths.patch b/3.4.3/4440_grsec-remove-protected-paths.patch |
3823 |
similarity index 100% |
3824 |
rename from 3.4.2/4440_grsec-remove-protected-paths.patch |
3825 |
rename to 3.4.3/4440_grsec-remove-protected-paths.patch |
3826 |
|
3827 |
diff --git a/3.4.2/4445_grsec-pax-without-grsec.patch b/3.4.3/4445_grsec-pax-without-grsec.patch |
3828 |
similarity index 100% |
3829 |
rename from 3.4.2/4445_grsec-pax-without-grsec.patch |
3830 |
rename to 3.4.3/4445_grsec-pax-without-grsec.patch |
3831 |
|
3832 |
diff --git a/3.4.2/4450_grsec-kconfig-default-gids.patch b/3.4.3/4450_grsec-kconfig-default-gids.patch |
3833 |
similarity index 100% |
3834 |
rename from 3.4.2/4450_grsec-kconfig-default-gids.patch |
3835 |
rename to 3.4.3/4450_grsec-kconfig-default-gids.patch |
3836 |
|
3837 |
diff --git a/3.4.2/4455_grsec-kconfig-gentoo.patch b/3.4.3/4455_grsec-kconfig-gentoo.patch |
3838 |
similarity index 100% |
3839 |
rename from 3.4.2/4455_grsec-kconfig-gentoo.patch |
3840 |
rename to 3.4.3/4455_grsec-kconfig-gentoo.patch |
3841 |
|
3842 |
diff --git a/3.4.2/4460-grsec-kconfig-proc-user.patch b/3.4.3/4460-grsec-kconfig-proc-user.patch |
3843 |
similarity index 100% |
3844 |
rename from 3.4.2/4460-grsec-kconfig-proc-user.patch |
3845 |
rename to 3.4.3/4460-grsec-kconfig-proc-user.patch |
3846 |
|
3847 |
diff --git a/3.4.2/4465_selinux-avc_audit-log-curr_ip.patch b/3.4.3/4465_selinux-avc_audit-log-curr_ip.patch |
3848 |
similarity index 100% |
3849 |
rename from 3.4.2/4465_selinux-avc_audit-log-curr_ip.patch |
3850 |
rename to 3.4.3/4465_selinux-avc_audit-log-curr_ip.patch |
3851 |
|
3852 |
diff --git a/3.4.2/4470_disable-compat_vdso.patch b/3.4.3/4470_disable-compat_vdso.patch |
3853 |
similarity index 100% |
3854 |
rename from 3.4.2/4470_disable-compat_vdso.patch |
3855 |
rename to 3.4.3/4470_disable-compat_vdso.patch |