diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2016-06-30 09:21:52 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2016-06-30 09:21:52 -0400 |
commit | 69430df88d9fcc4b3ad98e37688ac7d1dd4e7c6e (patch) | |
tree | 5383c862b60f9a203434c38d6a189ed006cc473f | |
parent | grsecurity-3.1-4.5.7-201606282216 (diff) | |
download | hardened-patchset-69430df88d9fcc4b3ad98e37688ac7d1dd4e7c6e.tar.gz hardened-patchset-69430df88d9fcc4b3ad98e37688ac7d1dd4e7c6e.tar.bz2 hardened-patchset-69430df88d9fcc4b3ad98e37688ac7d1dd4e7c6e.zip |
grsecurity-3.1-4.5.7-20160629230020160629
-rw-r--r-- | 4.5.7/0000_README | 2 | ||||
-rw-r--r-- | 4.5.7/4420_grsecurity-3.1-4.5.7-201606292300.patch (renamed from 4.5.7/4420_grsecurity-3.1-4.5.7-201606282216.patch) | 322 |
2 files changed, 295 insertions, 29 deletions
diff --git a/4.5.7/0000_README b/4.5.7/0000_README index b74e534..6531b4d 100644 --- a/4.5.7/0000_README +++ b/4.5.7/0000_README @@ -2,7 +2,7 @@ README ----------------------------------------------------------------------------- Individual Patch Descriptions: ----------------------------------------------------------------------------- -Patch: 4420_grsecurity-3.1-4.5.7-201606282216.patch +Patch: 4420_grsecurity-3.1-4.5.7-201606292300.patch From: http://www.grsecurity.net Desc: hardened-sources base patch from upstream grsecurity 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 index 01f7898..4f4d48f 100644 --- 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 @@ -49321,7 +49321,7 @@ index 6a27eb2..349ed23 100644 }; diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c -index c43318d..2574fc5 100644 +index c43318d..24bfd03 100644 --- a/drivers/hwmon/dell-smm-hwmon.c +++ b/drivers/hwmon/dell-smm-hwmon.c @@ -819,7 +819,7 @@ static const struct i8k_config_data i8k_config_data[] = { @@ -49329,7 +49329,7 @@ index c43318d..2574fc5 100644 }; -static struct dmi_system_id i8k_dmi_table[] __initdata = { -+static struct dmi_system_id i8k_dmi_table[] __initconst = { ++static const struct dmi_system_id i8k_dmi_table[] __initconst = { { .ident = "Dell Inspiron", .matches = { @@ -49338,7 +49338,7 @@ index c43318d..2574fc5 100644 MODULE_DEVICE_TABLE(dmi, i8k_dmi_table); -static struct dmi_system_id i8k_blacklist_dmi_table[] __initdata = { -+static struct dmi_system_id i8k_blacklist_dmi_table[] __initconst = { ++static const struct dmi_system_id i8k_blacklist_dmi_table[] __initconst = { { /* * CPU fan speed going up and down on Dell Studio XPS 8000 @@ -58553,6 +58553,19 @@ index 556a2df..e771329 100644 { spin_lock(&sbc_gxx_spin); sbc_gxx_page(map, adr); +diff --git a/drivers/mtd/nand/brcmnand/brcmnand.h b/drivers/mtd/nand/brcmnand/brcmnand.h +index ef5eabb..2b61d03 100644 +--- a/drivers/mtd/nand/brcmnand/brcmnand.h ++++ b/drivers/mtd/nand/brcmnand/brcmnand.h +@@ -24,7 +24,7 @@ struct brcmnand_soc { + bool (*ctlrdy_ack)(struct brcmnand_soc *soc); + void (*ctlrdy_set_enabled)(struct brcmnand_soc *soc, bool en); + void (*prepare_data_bus)(struct brcmnand_soc *soc, bool prepare); +-}; ++} __no_const; + + static inline void brcmnand_soc_data_bus_prepare(struct brcmnand_soc *soc) + { diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index aa1a616..a47a33d 100644 --- a/drivers/mtd/nand/cafe_nand.c @@ -62716,6 +62729,18 @@ index f9db2ce..6cd460c 100644 return ring_first(r); } +diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c +index a400288..0c59bcd 100644 +--- a/drivers/net/loopback.c ++++ b/drivers/net/loopback.c +@@ -217,6 +217,6 @@ out: + } + + /* Registered in net/core/dev.c */ +-struct pernet_operations __net_initdata loopback_net_ops = { ++struct pernet_operations __net_initconst loopback_net_ops = { + .init = loopback_net_init, + }; diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 94e6888..c5c3f55 100644 --- a/drivers/net/macvlan.c @@ -114042,7 +114067,7 @@ index f8595e8..e0d13cbd 100644 seq_putc(m, '\n'); diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c -index 350984a..0fb02a9 100644 +index 350984a..a78a18c 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -23,9 +23,27 @@ @@ -114107,6 +114132,15 @@ index 350984a..0fb02a9 100644 err = -ENXIO; net = get_proc_net(inode); if (net == NULL) +@@ -220,7 +251,7 @@ static __net_exit void proc_net_ns_exit(struct net *net) + kfree(net->proc_net); + } + +-static struct pernet_operations __net_initdata proc_net_ns_ops = { ++static struct pernet_operations __net_initconst proc_net_ns_ops = { + .init = proc_net_ns_init, + .exit = proc_net_ns_exit, + }; diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index fe5b6e6..cd2913c 100644 --- a/fs/proc/proc_sysctl.c @@ -132854,7 +132888,7 @@ index 25ef630..fc83c44 100644 struct iovec; struct kvec; diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 6d1d8f4..f1ed976 100644 +index 6d1d8f4..e9b37d6 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1257,6 +1257,7 @@ struct net_device_ops { @@ -132885,6 +132919,15 @@ index 6d1d8f4..f1ed976 100644 #ifdef CONFIG_WIRELESS_EXT const struct iw_handler_def * wireless_handlers; +@@ -4069,7 +4070,7 @@ static inline void netif_keep_dst(struct net_device *dev) + dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM); + } + +-extern struct pernet_operations __net_initdata loopback_net_ops; ++extern struct pernet_operations __net_initconst loopback_net_ops; + + /* Logging, debugging and troubleshooting/diagnostic helpers. */ + diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 0ad5567..79b35f5a 100644 --- a/include/linux/netfilter.h @@ -138381,7 +138424,7 @@ index 798cad1..d6ffc17 100644 if ((requested_mode & ~granted_mode & 0007) && !ns_capable(ns->user_ns, CAP_IPC_OWNER)) diff --git a/kernel/audit.c b/kernel/audit.c -index 3a3e5de..3a2baad 100644 +index 3a3e5de..2f79ee6 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -123,7 +123,7 @@ u32 audit_sig_sid = 0; @@ -138420,6 +138463,15 @@ index 3a3e5de..3a2baad 100644 s.backlog = skb_queue_len(&audit_skb_queue); s.feature_bitmap = AUDIT_FEATURE_BITMAP_ALL; s.backlog_wait_time = audit_backlog_wait_time_master; +@@ -1156,7 +1156,7 @@ static void __net_exit audit_net_exit(struct net *net) + netlink_kernel_release(sock); + } + +-static struct pernet_operations audit_net_ops __net_initdata = { ++static struct pernet_operations audit_net_ops __net_initconst = { + .init = audit_net_init, + .exit = audit_net_exit, + .id = &audit_net_id, diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 195ffae..fb880f9 100644 --- a/kernel/auditsc.c @@ -153409,7 +153461,7 @@ index fa9dc64..73dd85a 100644 return err; diff --git a/net/core/dev.c b/net/core/dev.c -index 0ef061b..6d2375a 100644 +index 0ef061b..94ee1d8 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1766,7 +1766,7 @@ int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb) @@ -153477,6 +153529,24 @@ index 0ef061b..6d2375a 100644 return storage; } EXPORT_SYMBOL(dev_get_stats); +@@ -7922,7 +7922,7 @@ static void __net_exit netdev_exit(struct net *net) + kfree(net->dev_index_head); + } + +-static struct pernet_operations __net_initdata netdev_net_ops = { ++static struct pernet_operations __net_initconst netdev_net_ops = { + .init = netdev_init, + .exit = netdev_exit, + }; +@@ -8022,7 +8022,7 @@ static void __net_exit default_device_exit_batch(struct list_head *net_list) + rtnl_unlock(); + } + +-static struct pernet_operations __net_initdata default_device_ops = { ++static struct pernet_operations __net_initconst default_device_ops = { + .exit = default_device_exit, + .exit_batch = default_device_exit_batch, + }; diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index b94b1d2..da3ed7c 100644 --- a/net/core/dev_ioctl.c @@ -153648,7 +153718,7 @@ index f18ae91..f033693 100644 tmp.extra1 = &zero; diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c -index 2bf8329..2eb1423 100644 +index 2bf8329..ea323e4 100644 --- a/net/core/net-procfs.c +++ b/net/core/net-procfs.c @@ -79,7 +79,13 @@ static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev) @@ -153698,6 +153768,24 @@ index 2bf8329..2eb1423 100644 } return 0; +@@ -347,7 +358,7 @@ static void __net_exit dev_proc_net_exit(struct net *net) + remove_proc_entry("dev", net->proc_net); + } + +-static struct pernet_operations __net_initdata dev_proc_ops = { ++static struct pernet_operations __net_initconst dev_proc_ops = { + .init = dev_proc_net_init, + .exit = dev_proc_net_exit, + }; +@@ -409,7 +420,7 @@ static void __net_exit dev_mc_net_exit(struct net *net) + remove_proc_entry("dev_mcast", net->proc_net); + } + +-static struct pernet_operations __net_initdata dev_mc_net_ops = { ++static struct pernet_operations __net_initconst dev_mc_net_ops = { + .init = dev_mc_net_init, + .exit = dev_mc_net_exit, + }; diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index b6c8a66..0da5ffc 100644 --- a/net/core/net-sysfs.c @@ -153712,9 +153800,18 @@ index b6c8a66..0da5ffc 100644 static DEVICE_ATTR_RO(carrier_changes); diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c -index 2c2eb1b..a53be3e 100644 +index 2c2eb1b..2f3b518 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c +@@ -526,7 +526,7 @@ static __net_exit void net_ns_net_exit(struct net *net) + ns_free_inum(&net->ns); + } + +-static struct pernet_operations __net_initdata net_ns_ops = { ++static struct pernet_operations __net_initconst net_ns_ops = { + .init = net_ns_net_init, + .exit = net_ns_net_exit, + }; @@ -775,7 +775,7 @@ static int __register_pernet_operations(struct list_head *list, int error; LIST_HEAD(net_exit_list); @@ -153936,7 +154033,7 @@ index 9835d9a..d49237a 100644 } diff --git a/net/core/sock.c b/net/core/sock.c -index 6c1c8bc..325316d 100644 +index 6c1c8bc..20a14a7 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -409,7 +409,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) @@ -154100,6 +154197,15 @@ index 6c1c8bc..325316d 100644 msg->msg_flags |= MSG_ERRQUEUE; err = copied; +@@ -3004,7 +3009,7 @@ static __net_exit void proto_exit_net(struct net *net) + } + + +-static __net_initdata struct pernet_operations proto_net_ops = { ++static __net_initconst struct pernet_operations proto_net_ops = { + .init = proto_init_net, + .exit = proto_exit_net, + }; diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index a996ce8..e0d5d3d 100644 --- a/net/core/sock_diag.c @@ -154410,7 +154516,7 @@ index c35fdfa..063ef67 100644 return NULL; } diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c -index 5c5db66..c10a4a2 100644 +index 5c5db66..cc029f2 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1389,7 +1389,7 @@ int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) @@ -154422,6 +154528,24 @@ index 5c5db66..c10a4a2 100644 #endif return -EINVAL; } +@@ -1591,7 +1591,7 @@ static __net_exit void ipv4_mib_exit_net(struct net *net) + free_percpu(net->mib.tcp_statistics); + } + +-static __net_initdata struct pernet_operations ipv4_mib_ops = { ++static __net_initconst struct pernet_operations ipv4_mib_ops = { + .init = ipv4_mib_init_net, + .exit = ipv4_mib_exit_net, + }; +@@ -1624,7 +1624,7 @@ static __net_exit void inet_exit_net(struct net *net) + { + } + +-static __net_initdata struct pernet_operations af_inet_ops = { ++static __net_initconst struct pernet_operations af_inet_ops = { + .init = inet_init_net, + .exit = inet_exit_net, + }; diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 59b3e0e..ff060b8 100644 --- a/net/ipv4/arp.c @@ -154436,7 +154560,7 @@ index 59b3e0e..ff060b8 100644 struct dst_entry *dst = NULL; diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c -index 0212591..329a13a 100644 +index 0212591..250d044 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -69,7 +69,8 @@ @@ -154526,6 +154650,15 @@ index 0212591..329a13a 100644 err_alloc_ctl: #endif if (dflt != &ipv4_devconf_dflt) +@@ -2368,7 +2372,7 @@ static __net_exit void devinet_exit_net(struct net *net) + kfree(net->ipv4.devconf_all); + } + +-static __net_initdata struct pernet_operations devinet_ops = { ++static __net_initconst struct pernet_operations devinet_ops = { + .init = devinet_init_net, + .exit = devinet_exit_net, + }; diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 63566ec..82e85abc8 100644 --- a/net/ipv4/fib_frontend.c @@ -154567,6 +154700,19 @@ index 2b68418..fb7bee8 100644 return nh->nh_saddr; } +diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c +index 36e2697..33cf94a 100644 +--- a/net/ipv4/icmp.c ++++ b/net/ipv4/icmp.c +@@ -1231,7 +1231,7 @@ fail: + return err; + } + +-static struct pernet_operations __net_initdata icmp_sk_ops = { ++static struct pernet_operations __net_initconst icmp_sk_ops = { + .init = icmp_sk_init, + .exit = icmp_sk_exit, + }; diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 6414891..30ec9bf 100644 --- a/net/ipv4/inet_connection_sock.c @@ -155328,7 +155474,7 @@ index d3a2716..884331c 100644 static int ping_v4_seq_show(struct seq_file *seq, void *v) diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c -index 3abd9d7..c5e4052 100644 +index 3abd9d7..50f84dbc 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c @@ -333,7 +333,7 @@ static void icmpmsg_put(struct seq_file *seq) @@ -155365,8 +155511,17 @@ index 3abd9d7..c5e4052 100644 } /* +@@ -532,7 +532,7 @@ static __net_exit void ip_proc_exit_net(struct net *net) + remove_proc_entry("sockstat", net->proc_net); + } + +-static __net_initdata struct pernet_operations ip_proc_ops = { ++static __net_initconst struct pernet_operations ip_proc_ops = { + .init = ip_proc_init_net, + .exit = ip_proc_exit_net, + }; diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c -index 7113bae..0e9e9a6 100644 +index 7113bae..8d468b5 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -323,7 +323,7 @@ static int raw_rcv_skb(struct sock *sk, struct sk_buff *skb) @@ -155420,8 +155575,17 @@ index 7113bae..0e9e9a6 100644 } static int raw_seq_show(struct seq_file *seq, void *v) +@@ -1095,7 +1099,7 @@ static __net_exit void raw_exit_net(struct net *net) + remove_proc_entry("raw", net->proc_net); + } + +-static __net_initdata struct pernet_operations raw_net_ops = { ++static __net_initconst struct pernet_operations raw_net_ops = { + .init = raw_init_net, + .exit = raw_exit_net, + }; diff --git a/net/ipv4/route.c b/net/ipv4/route.c -index b050cf9..3b7fc47 100644 +index b050cf9..562413b 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -232,7 +232,7 @@ static const struct seq_operations rt_cache_seq_ops = { @@ -155451,6 +155615,15 @@ index b050cf9..3b7fc47 100644 } static const struct file_operations rt_acct_proc_fops = { +@@ -413,7 +413,7 @@ static void __net_exit ip_rt_do_proc_exit(struct net *net) + #endif + } + +-static struct pernet_operations ip_rt_proc_ops __net_initdata = { ++static struct pernet_operations ip_rt_proc_ops __net_initconst = { + .init = ip_rt_do_proc_init, + .exit = ip_rt_do_proc_exit, + }; @@ -463,7 +463,7 @@ static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, #define IP_IDENTS_SZ 2048u @@ -155521,7 +155694,16 @@ index b050cf9..3b7fc47 100644 err_dup: return -ENOMEM; } -@@ -2817,8 +2817,8 @@ static __net_initdata struct pernet_operations sysctl_route_ops = { +@@ -2809,7 +2809,7 @@ static __net_exit void sysctl_route_net_exit(struct net *net) + kfree(tbl); + } + +-static __net_initdata struct pernet_operations sysctl_route_ops = { ++static __net_initconst struct pernet_operations sysctl_route_ops = { + .init = sysctl_route_net_init, + .exit = sysctl_route_net_exit, + }; +@@ -2817,14 +2817,14 @@ static __net_initdata struct pernet_operations sysctl_route_ops = { static __net_init int rt_genid_init(struct net *net) { @@ -155532,6 +155714,22 @@ index b050cf9..3b7fc47 100644 get_random_bytes(&net->ipv4.dev_addr_genid, sizeof(net->ipv4.dev_addr_genid)); return 0; + } + +-static __net_initdata struct pernet_operations rt_genid_ops = { ++static __net_initconst struct pernet_operations rt_genid_ops = { + .init = rt_genid_init, + }; + +@@ -2848,7 +2848,7 @@ static void __net_exit ipv4_inetpeer_exit(struct net *net) + kfree(bp); + } + +-static __net_initdata struct pernet_operations ipv4_inetpeer_ops = { ++static __net_initconst struct pernet_operations ipv4_inetpeer_ops = { + .init = ipv4_inetpeer_init, + .exit = ipv4_inetpeer_exit, + }; @@ -2862,11 +2862,7 @@ int __init ip_rt_init(void) int rc = 0; int cpu; @@ -155546,7 +155744,7 @@ index b050cf9..3b7fc47 100644 ip_tstamps = kcalloc(IP_IDENTS_SZ, sizeof(*ip_tstamps), GFP_KERNEL); if (!ip_tstamps) diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c -index 4d367b4..84f04b1 100644 +index 4d367b4..aff5814 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -66,7 +66,7 @@ static int ipv4_local_port_range(struct ctl_table *table, int write, @@ -155631,6 +155829,15 @@ index 4d367b4..84f04b1 100644 if (!net->ipv4.ipv4_hdr) goto err_reg; +@@ -1009,7 +1011,7 @@ static __net_exit void ipv4_sysctl_exit_net(struct net *net) + kfree(table); + } + +-static __net_initdata struct pernet_operations ipv4_sysctl_ops = { ++static __net_initconst struct pernet_operations ipv4_sysctl_ops = { + .init = ipv4_sysctl_init_net, + .exit = ipv4_sysctl_exit_net, + }; diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 3b2c8e9..601c090 100644 --- a/net/ipv4/tcp_input.c @@ -155702,7 +155909,7 @@ index 3b2c8e9..601c090 100644 write_pnet(&ireq->ireq_net, sock_net(sk_listener)); ireq->ireq_family = sk_listener->sk_family; diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index a7b1a90..9f6c261 100644 +index a7b1a90..56a4c5e 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -88,6 +88,10 @@ int sysctl_tcp_tw_reuse __read_mostly; @@ -155760,6 +155967,28 @@ index a7b1a90..9f6c261 100644 tcp_v4_send_reset(NULL, skb); } +@@ -2405,7 +2423,7 @@ static void __net_exit tcp_sk_exit_batch(struct list_head *net_exit_list) + inet_twsk_purge(&tcp_hashinfo, &tcp_death_row, AF_INET); + } + +-static struct pernet_operations __net_initdata tcp_sk_ops = { ++static struct pernet_operations __net_initconst tcp_sk_ops = { + .init = tcp_sk_init, + .exit = tcp_sk_exit, + .exit_batch = tcp_sk_exit_batch, +diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c +index a726d78..efd778e 100644 +--- a/net/ipv4/tcp_metrics.c ++++ b/net/ipv4/tcp_metrics.c +@@ -1163,7 +1163,7 @@ static void __net_exit tcp_net_metrics_exit(struct net *net) + tcp_metrics_flush_all(net); + } + +-static __net_initdata struct pernet_operations tcp_net_metrics_ops = { ++static __net_initconst struct pernet_operations tcp_net_metrics_ops = { + .init = tcp_net_metrics_init, + .exit = tcp_net_metrics_exit, + }; diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 9b02af2..5b73e16 100644 --- a/net/ipv4/tcp_minisocks.c @@ -155961,7 +156190,7 @@ index fd840c7..b517627 100644 struct iphdr *iph = ip_hdr(skb); int ihl = iph->ihl * 4; diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c -index 7b0edb3..785b3f6 100644 +index 7b0edb3..f597227 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -215,11 +215,11 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse) @@ -156013,6 +156242,15 @@ index 7b0edb3..785b3f6 100644 err_alloc: return -ENOMEM; } +@@ -369,7 +368,7 @@ static void __net_exit xfrm4_net_exit(struct net *net) + dst_entries_destroy(&net->xfrm.xfrm4_dst_ops); + } + +-static struct pernet_operations __net_initdata xfrm4_net_ops = { ++static struct pernet_operations __net_initconst xfrm4_net_ops = { + .init = xfrm4_net_init, + .exit = xfrm4_net_exit, + }; diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c index 542074c..648df74 100644 --- a/net/ipv4/xfrm4_state.c @@ -159235,7 +159473,7 @@ index 11de55e..f25e448 100644 return 0; } diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c -index d2bc03f..a95bb86 100644 +index d2bc03f..94d26ac 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -287,7 +287,7 @@ static void netlink_overrun(struct sock *sk) @@ -159287,6 +159525,15 @@ index d2bc03f..a95bb86 100644 sock_i_ino(s) ); +@@ -3295,7 +3297,7 @@ static void __init netlink_add_usersock_entry(void) + netlink_table_ungrab(); + } + +-static struct pernet_operations __net_initdata netlink_net_ops = { ++static struct pernet_operations __net_initconst netlink_net_ops = { + .init = netlink_net_init, + .exit = netlink_net_exit, + }; diff --git a/net/netlink/diag.c b/net/netlink/diag.c index 3ee63a3cf..d6df4d8 100644 --- a/net/netlink/diag.c @@ -162097,7 +162344,7 @@ index 0917f04..f4e3d8c 100644 if (!proc_create("x25/route", S_IRUGO, init_net.proc_net, diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c -index b5e665b..3030b1d 100644 +index b5e665b..cc7abfa 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -332,7 +332,7 @@ static void xfrm_policy_kill(struct xfrm_policy *policy) @@ -162166,6 +162413,15 @@ index b5e665b..3030b1d 100644 } return err; } +@@ -3074,7 +3072,7 @@ static void __net_exit xfrm_net_exit(struct net *net) + xfrm_statistics_fini(net); + } + +-static struct pernet_operations __net_initdata xfrm_net_ops = { ++static struct pernet_operations __net_initconst xfrm_net_ops = { + .init = xfrm_net_init, + .exit = xfrm_net_exit, + }; @@ -3266,7 +3264,7 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol, sizeof(pol->xfrm_vec[i].saddr)); pol->xfrm_vec[i].encap_family = mp->new_family; @@ -163626,10 +163882,10 @@ index 0000000..ffe60f6 +} diff --git a/scripts/gcc-plugins/constify_plugin.c b/scripts/gcc-plugins/constify_plugin.c new file mode 100644 -index 0000000..e25c12c +index 0000000..7a047cd --- /dev/null +++ b/scripts/gcc-plugins/constify_plugin.c -@@ -0,0 +1,574 @@ +@@ -0,0 +1,583 @@ +/* + * Copyright 2011 by Emese Revfy <re.emese@gmail.com> + * Copyright 2011-2016 by PaX Team <pageexec@freemail.hu> @@ -164026,6 +164282,9 @@ index 0000000..e25c12c + tree var = NODE_DECL(node); + tree type = TREE_TYPE(var); + ++ if (node->alias) ++ return false; ++ + if (DECL_EXTERNAL(var)) + return false; + @@ -164053,7 +164312,13 @@ index 0000000..e25c12c + var = NODE_DECL(node); + section = lookup_attribute("section", DECL_ATTRIBUTES(var)); + if (!section) { -+ gcc_assert(!get_decl_section_name(var)); ++ const char *name = get_decl_section_name(var); ++ ++ if (name) { ++ fprintf(stderr, "DECL_SECTION [%s] ", name); ++ dump_varpool_node(stderr, node); ++ gcc_unreachable(); ++ } + return; + } else + gcc_assert(get_decl_section_name(var)); @@ -164206,10 +164471,10 @@ index 0000000..e25c12c +} diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h new file mode 100644 -index 0000000..fd6362e7 +index 0000000..7b14844 --- /dev/null +++ b/scripts/gcc-plugins/gcc-common.h -@@ -0,0 +1,892 @@ +@@ -0,0 +1,893 @@ +#ifndef GCC_COMMON_H_INCLUDED +#define GCC_COMMON_H_INCLUDED + @@ -164751,8 +165016,8 @@ index 0000000..fd6362e7 + +static inline const char *get_decl_section_name(const_tree decl) +{ -+ if (!DECL_SECTION_NAME(decl)) -+ return NULL; ++ if (DECL_SECTION_NAME(decl) == NULL_TREE) ++ return NULL; + + return TREE_STRING_POINTER(DECL_SECTION_NAME(decl)); +} @@ -164887,6 +165152,7 @@ index 0000000..fd6362e7 +#define cgraph_n_nodes symtab->cgraph_count +#define cgraph_max_uid symtab->cgraph_max_uid +#define varpool_get_node(decl) varpool_node::get(decl) ++#define dump_varpool_node(file, node) (node)->dump(file) + +#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \ + (caller)->create_edge((callee), (call_stmt), (count), (freq)) |