]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
selinux: constify nf_hook_ops
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Sat, 26 Aug 2017 10:47:35 +0000 (16:17 +0530)
committerPaul Moore <paul@paul-moore.com>
Mon, 28 Aug 2017 21:33:19 +0000 (17:33 -0400)
nf_hook_ops are not supposed to change at runtime. nf_register_net_hooks
and nf_unregister_net_hooks are working with const nf_hook_ops.
So mark the non-const nf_hook_ops structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c

index f803fdcde9cf6146ebff7bb83efe2ede001fa6c5..45943e18da8bbd3409e35a1fff55cf3dc26a9f45 100644 (file)
@@ -6550,7 +6550,7 @@ security_initcall(selinux_init);
 
 #if defined(CONFIG_NETFILTER)
 
-static struct nf_hook_ops selinux_nf_ops[] = {
+static const struct nf_hook_ops selinux_nf_ops[] = {
        {
                .hook =         selinux_ipv4_postroute,
                .pf =           NFPROTO_IPV4,