Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-patchset:master commit in: 4.5.7/
Date: Thu, 30 Jun 2016 13:19:59
Message-Id: 1467292912.69430df88d9fcc4b3ad98e37688ac7d1dd4e7c6e.blueness@gentoo
1 commit: 69430df88d9fcc4b3ad98e37688ac7d1dd4e7c6e
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 30 13:21:52 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 30 13:21:52 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/hardened-patchset.git/commit/?id=69430df8
7
8 grsecurity-3.1-4.5.7-201606292300
9
10 4.5.7/0000_README | 2 +-
11 ...> 4420_grsecurity-3.1-4.5.7-201606292300.patch} | 322 +++++++++++++++++++--
12 2 files changed, 295 insertions(+), 29 deletions(-)
13
14 diff --git a/4.5.7/0000_README b/4.5.7/0000_README
15 index b74e534..6531b4d 100644
16 --- a/4.5.7/0000_README
17 +++ b/4.5.7/0000_README
18 @@ -2,7 +2,7 @@ README
19 -----------------------------------------------------------------------------
20 Individual Patch Descriptions:
21 -----------------------------------------------------------------------------
22 -Patch: 4420_grsecurity-3.1-4.5.7-201606282216.patch
23 +Patch: 4420_grsecurity-3.1-4.5.7-201606292300.patch
24 From: http://www.grsecurity.net
25 Desc: hardened-sources base patch from upstream grsecurity
26
27
28 diff --git a/4.5.7/4420_grsecurity-3.1-4.5.7-201606282216.patch b/4.5.7/4420_grsecurity-3.1-4.5.7-201606292300.patch
29 similarity index 99%
30 rename from 4.5.7/4420_grsecurity-3.1-4.5.7-201606282216.patch
31 rename to 4.5.7/4420_grsecurity-3.1-4.5.7-201606292300.patch
32 index 01f7898..4f4d48f 100644
33 --- a/4.5.7/4420_grsecurity-3.1-4.5.7-201606282216.patch
34 +++ b/4.5.7/4420_grsecurity-3.1-4.5.7-201606292300.patch
35 @@ -49321,7 +49321,7 @@ index 6a27eb2..349ed23 100644
36 };
37
38 diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
39 -index c43318d..2574fc5 100644
40 +index c43318d..24bfd03 100644
41 --- a/drivers/hwmon/dell-smm-hwmon.c
42 +++ b/drivers/hwmon/dell-smm-hwmon.c
43 @@ -819,7 +819,7 @@ static const struct i8k_config_data i8k_config_data[] = {
44 @@ -49329,7 +49329,7 @@ index c43318d..2574fc5 100644
45 };
46
47 -static struct dmi_system_id i8k_dmi_table[] __initdata = {
48 -+static struct dmi_system_id i8k_dmi_table[] __initconst = {
49 ++static const struct dmi_system_id i8k_dmi_table[] __initconst = {
50 {
51 .ident = "Dell Inspiron",
52 .matches = {
53 @@ -49338,7 +49338,7 @@ index c43318d..2574fc5 100644
54 MODULE_DEVICE_TABLE(dmi, i8k_dmi_table);
55
56 -static struct dmi_system_id i8k_blacklist_dmi_table[] __initdata = {
57 -+static struct dmi_system_id i8k_blacklist_dmi_table[] __initconst = {
58 ++static const struct dmi_system_id i8k_blacklist_dmi_table[] __initconst = {
59 {
60 /*
61 * CPU fan speed going up and down on Dell Studio XPS 8000
62 @@ -58553,6 +58553,19 @@ index 556a2df..e771329 100644
63 {
64 spin_lock(&sbc_gxx_spin);
65 sbc_gxx_page(map, adr);
66 +diff --git a/drivers/mtd/nand/brcmnand/brcmnand.h b/drivers/mtd/nand/brcmnand/brcmnand.h
67 +index ef5eabb..2b61d03 100644
68 +--- a/drivers/mtd/nand/brcmnand/brcmnand.h
69 ++++ b/drivers/mtd/nand/brcmnand/brcmnand.h
70 +@@ -24,7 +24,7 @@ struct brcmnand_soc {
71 + bool (*ctlrdy_ack)(struct brcmnand_soc *soc);
72 + void (*ctlrdy_set_enabled)(struct brcmnand_soc *soc, bool en);
73 + void (*prepare_data_bus)(struct brcmnand_soc *soc, bool prepare);
74 +-};
75 ++} __no_const;
76 +
77 + static inline void brcmnand_soc_data_bus_prepare(struct brcmnand_soc *soc)
78 + {
79 diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
80 index aa1a616..a47a33d 100644
81 --- a/drivers/mtd/nand/cafe_nand.c
82 @@ -62716,6 +62729,18 @@ index f9db2ce..6cd460c 100644
83 return ring_first(r);
84 }
85
86 +diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
87 +index a400288..0c59bcd 100644
88 +--- a/drivers/net/loopback.c
89 ++++ b/drivers/net/loopback.c
90 +@@ -217,6 +217,6 @@ out:
91 + }
92 +
93 + /* Registered in net/core/dev.c */
94 +-struct pernet_operations __net_initdata loopback_net_ops = {
95 ++struct pernet_operations __net_initconst loopback_net_ops = {
96 + .init = loopback_net_init,
97 + };
98 diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
99 index 94e6888..c5c3f55 100644
100 --- a/drivers/net/macvlan.c
101 @@ -114042,7 +114067,7 @@ index f8595e8..e0d13cbd 100644
102
103 seq_putc(m, '\n');
104 diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
105 -index 350984a..0fb02a9 100644
106 +index 350984a..a78a18c 100644
107 --- a/fs/proc/proc_net.c
108 +++ b/fs/proc/proc_net.c
109 @@ -23,9 +23,27 @@
110 @@ -114107,6 +114132,15 @@ index 350984a..0fb02a9 100644
111 err = -ENXIO;
112 net = get_proc_net(inode);
113 if (net == NULL)
114 +@@ -220,7 +251,7 @@ static __net_exit void proc_net_ns_exit(struct net *net)
115 + kfree(net->proc_net);
116 + }
117 +
118 +-static struct pernet_operations __net_initdata proc_net_ns_ops = {
119 ++static struct pernet_operations __net_initconst proc_net_ns_ops = {
120 + .init = proc_net_ns_init,
121 + .exit = proc_net_ns_exit,
122 + };
123 diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
124 index fe5b6e6..cd2913c 100644
125 --- a/fs/proc/proc_sysctl.c
126 @@ -132854,7 +132888,7 @@ index 25ef630..fc83c44 100644
127 struct iovec;
128 struct kvec;
129 diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
130 -index 6d1d8f4..f1ed976 100644
131 +index 6d1d8f4..e9b37d6 100644
132 --- a/include/linux/netdevice.h
133 +++ b/include/linux/netdevice.h
134 @@ -1257,6 +1257,7 @@ struct net_device_ops {
135 @@ -132885,6 +132919,15 @@ index 6d1d8f4..f1ed976 100644
136
137 #ifdef CONFIG_WIRELESS_EXT
138 const struct iw_handler_def * wireless_handlers;
139 +@@ -4069,7 +4070,7 @@ static inline void netif_keep_dst(struct net_device *dev)
140 + dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM);
141 + }
142 +
143 +-extern struct pernet_operations __net_initdata loopback_net_ops;
144 ++extern struct pernet_operations __net_initconst loopback_net_ops;
145 +
146 + /* Logging, debugging and troubleshooting/diagnostic helpers. */
147 +
148 diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
149 index 0ad5567..79b35f5a 100644
150 --- a/include/linux/netfilter.h
151 @@ -138381,7 +138424,7 @@ index 798cad1..d6ffc17 100644
152 if ((requested_mode & ~granted_mode & 0007) &&
153 !ns_capable(ns->user_ns, CAP_IPC_OWNER))
154 diff --git a/kernel/audit.c b/kernel/audit.c
155 -index 3a3e5de..3a2baad 100644
156 +index 3a3e5de..2f79ee6 100644
157 --- a/kernel/audit.c
158 +++ b/kernel/audit.c
159 @@ -123,7 +123,7 @@ u32 audit_sig_sid = 0;
160 @@ -138420,6 +138463,15 @@ index 3a3e5de..3a2baad 100644
161 s.backlog = skb_queue_len(&audit_skb_queue);
162 s.feature_bitmap = AUDIT_FEATURE_BITMAP_ALL;
163 s.backlog_wait_time = audit_backlog_wait_time_master;
164 +@@ -1156,7 +1156,7 @@ static void __net_exit audit_net_exit(struct net *net)
165 + netlink_kernel_release(sock);
166 + }
167 +
168 +-static struct pernet_operations audit_net_ops __net_initdata = {
169 ++static struct pernet_operations audit_net_ops __net_initconst = {
170 + .init = audit_net_init,
171 + .exit = audit_net_exit,
172 + .id = &audit_net_id,
173 diff --git a/kernel/auditsc.c b/kernel/auditsc.c
174 index 195ffae..fb880f9 100644
175 --- a/kernel/auditsc.c
176 @@ -153409,7 +153461,7 @@ index fa9dc64..73dd85a 100644
177
178 return err;
179 diff --git a/net/core/dev.c b/net/core/dev.c
180 -index 0ef061b..6d2375a 100644
181 +index 0ef061b..94ee1d8 100644
182 --- a/net/core/dev.c
183 +++ b/net/core/dev.c
184 @@ -1766,7 +1766,7 @@ int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
185 @@ -153477,6 +153529,24 @@ index 0ef061b..6d2375a 100644
186 return storage;
187 }
188 EXPORT_SYMBOL(dev_get_stats);
189 +@@ -7922,7 +7922,7 @@ static void __net_exit netdev_exit(struct net *net)
190 + kfree(net->dev_index_head);
191 + }
192 +
193 +-static struct pernet_operations __net_initdata netdev_net_ops = {
194 ++static struct pernet_operations __net_initconst netdev_net_ops = {
195 + .init = netdev_init,
196 + .exit = netdev_exit,
197 + };
198 +@@ -8022,7 +8022,7 @@ static void __net_exit default_device_exit_batch(struct list_head *net_list)
199 + rtnl_unlock();
200 + }
201 +
202 +-static struct pernet_operations __net_initdata default_device_ops = {
203 ++static struct pernet_operations __net_initconst default_device_ops = {
204 + .exit = default_device_exit,
205 + .exit_batch = default_device_exit_batch,
206 + };
207 diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
208 index b94b1d2..da3ed7c 100644
209 --- a/net/core/dev_ioctl.c
210 @@ -153648,7 +153718,7 @@ index f18ae91..f033693 100644
211
212 tmp.extra1 = &zero;
213 diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c
214 -index 2bf8329..2eb1423 100644
215 +index 2bf8329..ea323e4 100644
216 --- a/net/core/net-procfs.c
217 +++ b/net/core/net-procfs.c
218 @@ -79,7 +79,13 @@ static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev)
219 @@ -153698,6 +153768,24 @@ index 2bf8329..2eb1423 100644
220 }
221
222 return 0;
223 +@@ -347,7 +358,7 @@ static void __net_exit dev_proc_net_exit(struct net *net)
224 + remove_proc_entry("dev", net->proc_net);
225 + }
226 +
227 +-static struct pernet_operations __net_initdata dev_proc_ops = {
228 ++static struct pernet_operations __net_initconst dev_proc_ops = {
229 + .init = dev_proc_net_init,
230 + .exit = dev_proc_net_exit,
231 + };
232 +@@ -409,7 +420,7 @@ static void __net_exit dev_mc_net_exit(struct net *net)
233 + remove_proc_entry("dev_mcast", net->proc_net);
234 + }
235 +
236 +-static struct pernet_operations __net_initdata dev_mc_net_ops = {
237 ++static struct pernet_operations __net_initconst dev_mc_net_ops = {
238 + .init = dev_mc_net_init,
239 + .exit = dev_mc_net_exit,
240 + };
241 diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
242 index b6c8a66..0da5ffc 100644
243 --- a/net/core/net-sysfs.c
244 @@ -153712,9 +153800,18 @@ index b6c8a66..0da5ffc 100644
245 static DEVICE_ATTR_RO(carrier_changes);
246
247 diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
248 -index 2c2eb1b..a53be3e 100644
249 +index 2c2eb1b..2f3b518 100644
250 --- a/net/core/net_namespace.c
251 +++ b/net/core/net_namespace.c
252 +@@ -526,7 +526,7 @@ static __net_exit void net_ns_net_exit(struct net *net)
253 + ns_free_inum(&net->ns);
254 + }
255 +
256 +-static struct pernet_operations __net_initdata net_ns_ops = {
257 ++static struct pernet_operations __net_initconst net_ns_ops = {
258 + .init = net_ns_net_init,
259 + .exit = net_ns_net_exit,
260 + };
261 @@ -775,7 +775,7 @@ static int __register_pernet_operations(struct list_head *list,
262 int error;
263 LIST_HEAD(net_exit_list);
264 @@ -153936,7 +154033,7 @@ index 9835d9a..d49237a 100644
265 }
266
267 diff --git a/net/core/sock.c b/net/core/sock.c
268 -index 6c1c8bc..325316d 100644
269 +index 6c1c8bc..20a14a7 100644
270 --- a/net/core/sock.c
271 +++ b/net/core/sock.c
272 @@ -409,7 +409,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
273 @@ -154100,6 +154197,15 @@ index 6c1c8bc..325316d 100644
274
275 msg->msg_flags |= MSG_ERRQUEUE;
276 err = copied;
277 +@@ -3004,7 +3009,7 @@ static __net_exit void proto_exit_net(struct net *net)
278 + }
279 +
280 +
281 +-static __net_initdata struct pernet_operations proto_net_ops = {
282 ++static __net_initconst struct pernet_operations proto_net_ops = {
283 + .init = proto_init_net,
284 + .exit = proto_exit_net,
285 + };
286 diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
287 index a996ce8..e0d5d3d 100644
288 --- a/net/core/sock_diag.c
289 @@ -154410,7 +154516,7 @@ index c35fdfa..063ef67 100644
290 return NULL;
291 }
292 diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
293 -index 5c5db66..c10a4a2 100644
294 +index 5c5db66..cc029f2 100644
295 --- a/net/ipv4/af_inet.c
296 +++ b/net/ipv4/af_inet.c
297 @@ -1389,7 +1389,7 @@ int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
298 @@ -154422,6 +154528,24 @@ index 5c5db66..c10a4a2 100644
299 #endif
300 return -EINVAL;
301 }
302 +@@ -1591,7 +1591,7 @@ static __net_exit void ipv4_mib_exit_net(struct net *net)
303 + free_percpu(net->mib.tcp_statistics);
304 + }
305 +
306 +-static __net_initdata struct pernet_operations ipv4_mib_ops = {
307 ++static __net_initconst struct pernet_operations ipv4_mib_ops = {
308 + .init = ipv4_mib_init_net,
309 + .exit = ipv4_mib_exit_net,
310 + };
311 +@@ -1624,7 +1624,7 @@ static __net_exit void inet_exit_net(struct net *net)
312 + {
313 + }
314 +
315 +-static __net_initdata struct pernet_operations af_inet_ops = {
316 ++static __net_initconst struct pernet_operations af_inet_ops = {
317 + .init = inet_init_net,
318 + .exit = inet_exit_net,
319 + };
320 diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
321 index 59b3e0e..ff060b8 100644
322 --- a/net/ipv4/arp.c
323 @@ -154436,7 +154560,7 @@ index 59b3e0e..ff060b8 100644
324 struct dst_entry *dst = NULL;
325
326 diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
327 -index 0212591..329a13a 100644
328 +index 0212591..250d044 100644
329 --- a/net/ipv4/devinet.c
330 +++ b/net/ipv4/devinet.c
331 @@ -69,7 +69,8 @@
332 @@ -154526,6 +154650,15 @@ index 0212591..329a13a 100644
333 err_alloc_ctl:
334 #endif
335 if (dflt != &ipv4_devconf_dflt)
336 +@@ -2368,7 +2372,7 @@ static __net_exit void devinet_exit_net(struct net *net)
337 + kfree(net->ipv4.devconf_all);
338 + }
339 +
340 +-static __net_initdata struct pernet_operations devinet_ops = {
341 ++static __net_initconst struct pernet_operations devinet_ops = {
342 + .init = devinet_init_net,
343 + .exit = devinet_exit_net,
344 + };
345 diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
346 index 63566ec..82e85abc8 100644
347 --- a/net/ipv4/fib_frontend.c
348 @@ -154567,6 +154700,19 @@ index 2b68418..fb7bee8 100644
349
350 return nh->nh_saddr;
351 }
352 +diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
353 +index 36e2697..33cf94a 100644
354 +--- a/net/ipv4/icmp.c
355 ++++ b/net/ipv4/icmp.c
356 +@@ -1231,7 +1231,7 @@ fail:
357 + return err;
358 + }
359 +
360 +-static struct pernet_operations __net_initdata icmp_sk_ops = {
361 ++static struct pernet_operations __net_initconst icmp_sk_ops = {
362 + .init = icmp_sk_init,
363 + .exit = icmp_sk_exit,
364 + };
365 diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
366 index 6414891..30ec9bf 100644
367 --- a/net/ipv4/inet_connection_sock.c
368 @@ -155328,7 +155474,7 @@ index d3a2716..884331c 100644
369
370 static int ping_v4_seq_show(struct seq_file *seq, void *v)
371 diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
372 -index 3abd9d7..c5e4052 100644
373 +index 3abd9d7..50f84dbc 100644
374 --- a/net/ipv4/proc.c
375 +++ b/net/ipv4/proc.c
376 @@ -333,7 +333,7 @@ static void icmpmsg_put(struct seq_file *seq)
377 @@ -155365,8 +155511,17 @@ index 3abd9d7..c5e4052 100644
378 }
379
380 /*
381 +@@ -532,7 +532,7 @@ static __net_exit void ip_proc_exit_net(struct net *net)
382 + remove_proc_entry("sockstat", net->proc_net);
383 + }
384 +
385 +-static __net_initdata struct pernet_operations ip_proc_ops = {
386 ++static __net_initconst struct pernet_operations ip_proc_ops = {
387 + .init = ip_proc_init_net,
388 + .exit = ip_proc_exit_net,
389 + };
390 diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
391 -index 7113bae..0e9e9a6 100644
392 +index 7113bae..8d468b5 100644
393 --- a/net/ipv4/raw.c
394 +++ b/net/ipv4/raw.c
395 @@ -323,7 +323,7 @@ static int raw_rcv_skb(struct sock *sk, struct sk_buff *skb)
396 @@ -155420,8 +155575,17 @@ index 7113bae..0e9e9a6 100644
397 }
398
399 static int raw_seq_show(struct seq_file *seq, void *v)
400 +@@ -1095,7 +1099,7 @@ static __net_exit void raw_exit_net(struct net *net)
401 + remove_proc_entry("raw", net->proc_net);
402 + }
403 +
404 +-static __net_initdata struct pernet_operations raw_net_ops = {
405 ++static __net_initconst struct pernet_operations raw_net_ops = {
406 + .init = raw_init_net,
407 + .exit = raw_exit_net,
408 + };
409 diff --git a/net/ipv4/route.c b/net/ipv4/route.c
410 -index b050cf9..3b7fc47 100644
411 +index b050cf9..562413b 100644
412 --- a/net/ipv4/route.c
413 +++ b/net/ipv4/route.c
414 @@ -232,7 +232,7 @@ static const struct seq_operations rt_cache_seq_ops = {
415 @@ -155451,6 +155615,15 @@ index b050cf9..3b7fc47 100644
416 }
417
418 static const struct file_operations rt_acct_proc_fops = {
419 +@@ -413,7 +413,7 @@ static void __net_exit ip_rt_do_proc_exit(struct net *net)
420 + #endif
421 + }
422 +
423 +-static struct pernet_operations ip_rt_proc_ops __net_initdata = {
424 ++static struct pernet_operations ip_rt_proc_ops __net_initconst = {
425 + .init = ip_rt_do_proc_init,
426 + .exit = ip_rt_do_proc_exit,
427 + };
428 @@ -463,7 +463,7 @@ static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst,
429
430 #define IP_IDENTS_SZ 2048u
431 @@ -155521,7 +155694,16 @@ index b050cf9..3b7fc47 100644
432 err_dup:
433 return -ENOMEM;
434 }
435 -@@ -2817,8 +2817,8 @@ static __net_initdata struct pernet_operations sysctl_route_ops = {
436 +@@ -2809,7 +2809,7 @@ static __net_exit void sysctl_route_net_exit(struct net *net)
437 + kfree(tbl);
438 + }
439 +
440 +-static __net_initdata struct pernet_operations sysctl_route_ops = {
441 ++static __net_initconst struct pernet_operations sysctl_route_ops = {
442 + .init = sysctl_route_net_init,
443 + .exit = sysctl_route_net_exit,
444 + };
445 +@@ -2817,14 +2817,14 @@ static __net_initdata struct pernet_operations sysctl_route_ops = {
446
447 static __net_init int rt_genid_init(struct net *net)
448 {
449 @@ -155532,6 +155714,22 @@ index b050cf9..3b7fc47 100644
450 get_random_bytes(&net->ipv4.dev_addr_genid,
451 sizeof(net->ipv4.dev_addr_genid));
452 return 0;
453 + }
454 +
455 +-static __net_initdata struct pernet_operations rt_genid_ops = {
456 ++static __net_initconst struct pernet_operations rt_genid_ops = {
457 + .init = rt_genid_init,
458 + };
459 +
460 +@@ -2848,7 +2848,7 @@ static void __net_exit ipv4_inetpeer_exit(struct net *net)
461 + kfree(bp);
462 + }
463 +
464 +-static __net_initdata struct pernet_operations ipv4_inetpeer_ops = {
465 ++static __net_initconst struct pernet_operations ipv4_inetpeer_ops = {
466 + .init = ipv4_inetpeer_init,
467 + .exit = ipv4_inetpeer_exit,
468 + };
469 @@ -2862,11 +2862,7 @@ int __init ip_rt_init(void)
470 int rc = 0;
471 int cpu;
472 @@ -155546,7 +155744,7 @@ index b050cf9..3b7fc47 100644
473 ip_tstamps = kcalloc(IP_IDENTS_SZ, sizeof(*ip_tstamps), GFP_KERNEL);
474 if (!ip_tstamps)
475 diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
476 -index 4d367b4..84f04b1 100644
477 +index 4d367b4..aff5814 100644
478 --- a/net/ipv4/sysctl_net_ipv4.c
479 +++ b/net/ipv4/sysctl_net_ipv4.c
480 @@ -66,7 +66,7 @@ static int ipv4_local_port_range(struct ctl_table *table, int write,
481 @@ -155631,6 +155829,15 @@ index 4d367b4..84f04b1 100644
482 if (!net->ipv4.ipv4_hdr)
483 goto err_reg;
484
485 +@@ -1009,7 +1011,7 @@ static __net_exit void ipv4_sysctl_exit_net(struct net *net)
486 + kfree(table);
487 + }
488 +
489 +-static __net_initdata struct pernet_operations ipv4_sysctl_ops = {
490 ++static __net_initconst struct pernet_operations ipv4_sysctl_ops = {
491 + .init = ipv4_sysctl_init_net,
492 + .exit = ipv4_sysctl_exit_net,
493 + };
494 diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
495 index 3b2c8e9..601c090 100644
496 --- a/net/ipv4/tcp_input.c
497 @@ -155702,7 +155909,7 @@ index 3b2c8e9..601c090 100644
498 write_pnet(&ireq->ireq_net, sock_net(sk_listener));
499 ireq->ireq_family = sk_listener->sk_family;
500 diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
501 -index a7b1a90..9f6c261 100644
502 +index a7b1a90..56a4c5e 100644
503 --- a/net/ipv4/tcp_ipv4.c
504 +++ b/net/ipv4/tcp_ipv4.c
505 @@ -88,6 +88,10 @@ int sysctl_tcp_tw_reuse __read_mostly;
506 @@ -155760,6 +155967,28 @@ index a7b1a90..9f6c261 100644
507 tcp_v4_send_reset(NULL, skb);
508 }
509
510 +@@ -2405,7 +2423,7 @@ static void __net_exit tcp_sk_exit_batch(struct list_head *net_exit_list)
511 + inet_twsk_purge(&tcp_hashinfo, &tcp_death_row, AF_INET);
512 + }
513 +
514 +-static struct pernet_operations __net_initdata tcp_sk_ops = {
515 ++static struct pernet_operations __net_initconst tcp_sk_ops = {
516 + .init = tcp_sk_init,
517 + .exit = tcp_sk_exit,
518 + .exit_batch = tcp_sk_exit_batch,
519 +diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
520 +index a726d78..efd778e 100644
521 +--- a/net/ipv4/tcp_metrics.c
522 ++++ b/net/ipv4/tcp_metrics.c
523 +@@ -1163,7 +1163,7 @@ static void __net_exit tcp_net_metrics_exit(struct net *net)
524 + tcp_metrics_flush_all(net);
525 + }
526 +
527 +-static __net_initdata struct pernet_operations tcp_net_metrics_ops = {
528 ++static __net_initconst struct pernet_operations tcp_net_metrics_ops = {
529 + .init = tcp_net_metrics_init,
530 + .exit = tcp_net_metrics_exit,
531 + };
532 diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
533 index 9b02af2..5b73e16 100644
534 --- a/net/ipv4/tcp_minisocks.c
535 @@ -155961,7 +156190,7 @@ index fd840c7..b517627 100644
536 struct iphdr *iph = ip_hdr(skb);
537 int ihl = iph->ihl * 4;
538 diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
539 -index 7b0edb3..785b3f6 100644
540 +index 7b0edb3..f597227 100644
541 --- a/net/ipv4/xfrm4_policy.c
542 +++ b/net/ipv4/xfrm4_policy.c
543 @@ -215,11 +215,11 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
544 @@ -156013,6 +156242,15 @@ index 7b0edb3..785b3f6 100644
545 err_alloc:
546 return -ENOMEM;
547 }
548 +@@ -369,7 +368,7 @@ static void __net_exit xfrm4_net_exit(struct net *net)
549 + dst_entries_destroy(&net->xfrm.xfrm4_dst_ops);
550 + }
551 +
552 +-static struct pernet_operations __net_initdata xfrm4_net_ops = {
553 ++static struct pernet_operations __net_initconst xfrm4_net_ops = {
554 + .init = xfrm4_net_init,
555 + .exit = xfrm4_net_exit,
556 + };
557 diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
558 index 542074c..648df74 100644
559 --- a/net/ipv4/xfrm4_state.c
560 @@ -159235,7 +159473,7 @@ index 11de55e..f25e448 100644
561 return 0;
562 }
563 diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
564 -index d2bc03f..a95bb86 100644
565 +index d2bc03f..94d26ac 100644
566 --- a/net/netlink/af_netlink.c
567 +++ b/net/netlink/af_netlink.c
568 @@ -287,7 +287,7 @@ static void netlink_overrun(struct sock *sk)
569 @@ -159287,6 +159525,15 @@ index d2bc03f..a95bb86 100644
570 sock_i_ino(s)
571 );
572
573 +@@ -3295,7 +3297,7 @@ static void __init netlink_add_usersock_entry(void)
574 + netlink_table_ungrab();
575 + }
576 +
577 +-static struct pernet_operations __net_initdata netlink_net_ops = {
578 ++static struct pernet_operations __net_initconst netlink_net_ops = {
579 + .init = netlink_net_init,
580 + .exit = netlink_net_exit,
581 + };
582 diff --git a/net/netlink/diag.c b/net/netlink/diag.c
583 index 3ee63a3cf..d6df4d8 100644
584 --- a/net/netlink/diag.c
585 @@ -162097,7 +162344,7 @@ index 0917f04..f4e3d8c 100644
586
587 if (!proc_create("x25/route", S_IRUGO, init_net.proc_net,
588 diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
589 -index b5e665b..3030b1d 100644
590 +index b5e665b..cc7abfa 100644
591 --- a/net/xfrm/xfrm_policy.c
592 +++ b/net/xfrm/xfrm_policy.c
593 @@ -332,7 +332,7 @@ static void xfrm_policy_kill(struct xfrm_policy *policy)
594 @@ -162166,6 +162413,15 @@ index b5e665b..3030b1d 100644
595 }
596 return err;
597 }
598 +@@ -3074,7 +3072,7 @@ static void __net_exit xfrm_net_exit(struct net *net)
599 + xfrm_statistics_fini(net);
600 + }
601 +
602 +-static struct pernet_operations __net_initdata xfrm_net_ops = {
603 ++static struct pernet_operations __net_initconst xfrm_net_ops = {
604 + .init = xfrm_net_init,
605 + .exit = xfrm_net_exit,
606 + };
607 @@ -3266,7 +3264,7 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol,
608 sizeof(pol->xfrm_vec[i].saddr));
609 pol->xfrm_vec[i].encap_family = mp->new_family;
610 @@ -163626,10 +163882,10 @@ index 0000000..ffe60f6
611 +}
612 diff --git a/scripts/gcc-plugins/constify_plugin.c b/scripts/gcc-plugins/constify_plugin.c
613 new file mode 100644
614 -index 0000000..e25c12c
615 +index 0000000..7a047cd
616 --- /dev/null
617 +++ b/scripts/gcc-plugins/constify_plugin.c
618 -@@ -0,0 +1,574 @@
619 +@@ -0,0 +1,583 @@
620 +/*
621 + * Copyright 2011 by Emese Revfy <re.emese@×××××.com>
622 + * Copyright 2011-2016 by PaX Team <pageexec@××××××××.hu>
623 @@ -164026,6 +164282,9 @@ index 0000000..e25c12c
624 + tree var = NODE_DECL(node);
625 + tree type = TREE_TYPE(var);
626 +
627 ++ if (node->alias)
628 ++ return false;
629 ++
630 + if (DECL_EXTERNAL(var))
631 + return false;
632 +
633 @@ -164053,7 +164312,13 @@ index 0000000..e25c12c
634 + var = NODE_DECL(node);
635 + section = lookup_attribute("section", DECL_ATTRIBUTES(var));
636 + if (!section) {
637 -+ gcc_assert(!get_decl_section_name(var));
638 ++ const char *name = get_decl_section_name(var);
639 ++
640 ++ if (name) {
641 ++ fprintf(stderr, "DECL_SECTION [%s] ", name);
642 ++ dump_varpool_node(stderr, node);
643 ++ gcc_unreachable();
644 ++ }
645 + return;
646 + } else
647 + gcc_assert(get_decl_section_name(var));
648 @@ -164206,10 +164471,10 @@ index 0000000..e25c12c
649 +}
650 diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
651 new file mode 100644
652 -index 0000000..fd6362e7
653 +index 0000000..7b14844
654 --- /dev/null
655 +++ b/scripts/gcc-plugins/gcc-common.h
656 -@@ -0,0 +1,892 @@
657 +@@ -0,0 +1,893 @@
658 +#ifndef GCC_COMMON_H_INCLUDED
659 +#define GCC_COMMON_H_INCLUDED
660 +
661 @@ -164751,8 +165016,8 @@ index 0000000..fd6362e7
662 +
663 +static inline const char *get_decl_section_name(const_tree decl)
664 +{
665 -+ if (!DECL_SECTION_NAME(decl))
666 -+ return NULL;
667 ++ if (DECL_SECTION_NAME(decl) == NULL_TREE)
668 ++ return NULL;
669 +
670 + return TREE_STRING_POINTER(DECL_SECTION_NAME(decl));
671 +}
672 @@ -164887,6 +165152,7 @@ index 0000000..fd6362e7
673 +#define cgraph_n_nodes symtab->cgraph_count
674 +#define cgraph_max_uid symtab->cgraph_max_uid
675 +#define varpool_get_node(decl) varpool_node::get(decl)
676 ++#define dump_varpool_node(file, node) (node)->dump(file)
677 +
678 +#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \
679 + (caller)->create_edge((callee), (call_stmt), (count), (freq))