[PATCH] selinux: constify nf_hook_ops

Paul Moore paul at paul-moore.com
Mon Aug 28 21:34:31 UTC 2017


On Sat, Aug 26, 2017 at 6:47 AM, Arvind Yadav <arvind.yadav.cs at gmail.com> wrote:
> 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 at gmail.com>
> ---
>  security/selinux/hooks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Merged, thanks.

> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 33fd061..2f2e133 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -6530,7 +6530,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,
> --
> 2.7.4

-- 
paul moore
www.paul-moore.com
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the Linux-security-module-archive mailing list