aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Morris2017-03-06 10:58:08 -0600
committerPaul Moore2017-03-06 10:58:08 -0600
commit579fc0dc09111c1f8b94742a0ed5a0bb8fdddbb9 (patch)
treed22c8e547efa066dce035f690a514067e2a03f41 /security
parentca97d939db114c8d1619e10a3b82af8615372dae (diff)
downloadkernel-579fc0dc09111c1f8b94742a0ed5a0bb8fdddbb9.tar.gz
kernel-579fc0dc09111c1f8b94742a0ed5a0bb8fdddbb9.tar.xz
kernel-579fc0dc09111c1f8b94742a0ed5a0bb8fdddbb9.zip
selinux: constify nlmsg permission tables
Constify nlmsg permission tables, which are initialized once and then do not change. Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/nlmsgtab.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/security/selinux/nlmsgtab.c b/security/selinux/nlmsgtab.c
index 2ca9cde939d4..57e2596bdd8a 100644
--- a/security/selinux/nlmsgtab.c
+++ b/security/selinux/nlmsgtab.c
@@ -28,7 +28,7 @@ struct nlmsg_perm {
28 u32 perm; 28 u32 perm;
29}; 29};
30 30
31static struct nlmsg_perm nlmsg_route_perms[] = 31static const struct nlmsg_perm nlmsg_route_perms[] =
32{ 32{
33 { RTM_NEWLINK, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, 33 { RTM_NEWLINK, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
34 { RTM_DELLINK, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, 34 { RTM_DELLINK, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
@@ -80,7 +80,7 @@ static struct nlmsg_perm nlmsg_route_perms[] =
80 { RTM_GETSTATS, NETLINK_ROUTE_SOCKET__NLMSG_READ }, 80 { RTM_GETSTATS, NETLINK_ROUTE_SOCKET__NLMSG_READ },
81}; 81};
82 82
83static struct nlmsg_perm nlmsg_tcpdiag_perms[] = 83static const struct nlmsg_perm nlmsg_tcpdiag_perms[] =
84{ 84{
85 { TCPDIAG_GETSOCK, NETLINK_TCPDIAG_SOCKET__NLMSG_READ }, 85 { TCPDIAG_GETSOCK, NETLINK_TCPDIAG_SOCKET__NLMSG_READ },
86 { DCCPDIAG_GETSOCK, NETLINK_TCPDIAG_SOCKET__NLMSG_READ }, 86 { DCCPDIAG_GETSOCK, NETLINK_TCPDIAG_SOCKET__NLMSG_READ },
@@ -88,7 +88,7 @@ static struct nlmsg_perm nlmsg_tcpdiag_perms[] =
88 { SOCK_DESTROY, NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE }, 88 { SOCK_DESTROY, NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE },
89}; 89};
90 90
91static struct nlmsg_perm nlmsg_xfrm_perms[] = 91static const struct nlmsg_perm nlmsg_xfrm_perms[] =
92{ 92{
93 { XFRM_MSG_NEWSA, NETLINK_XFRM_SOCKET__NLMSG_WRITE }, 93 { XFRM_MSG_NEWSA, NETLINK_XFRM_SOCKET__NLMSG_WRITE },
94 { XFRM_MSG_DELSA, NETLINK_XFRM_SOCKET__NLMSG_WRITE }, 94 { XFRM_MSG_DELSA, NETLINK_XFRM_SOCKET__NLMSG_WRITE },
@@ -115,7 +115,7 @@ static struct nlmsg_perm nlmsg_xfrm_perms[] =
115 { XFRM_MSG_MAPPING, NETLINK_XFRM_SOCKET__NLMSG_READ }, 115 { XFRM_MSG_MAPPING, NETLINK_XFRM_SOCKET__NLMSG_READ },
116}; 116};
117 117
118static struct nlmsg_perm nlmsg_audit_perms[] = 118static const struct nlmsg_perm nlmsg_audit_perms[] =
119{ 119{
120 { AUDIT_GET, NETLINK_AUDIT_SOCKET__NLMSG_READ }, 120 { AUDIT_GET, NETLINK_AUDIT_SOCKET__NLMSG_READ },
121 { AUDIT_SET, NETLINK_AUDIT_SOCKET__NLMSG_WRITE }, 121 { AUDIT_SET, NETLINK_AUDIT_SOCKET__NLMSG_WRITE },
@@ -136,7 +136,7 @@ static struct nlmsg_perm nlmsg_audit_perms[] =
136}; 136};
137 137
138 138
139static int nlmsg_perm(u16 nlmsg_type, u32 *perm, struct nlmsg_perm *tab, size_t tabsize) 139static int nlmsg_perm(u16 nlmsg_type, u32 *perm, const struct nlmsg_perm *tab, size_t tabsize)
140{ 140{
141 int i, err = -EINVAL; 141 int i, err = -EINVAL;
142 142