Commit 579fc0dc authored by James Morris's avatar James Morris Committed by Paul Moore

selinux: constify nlmsg permission tables

Constify nlmsg permission tables, which are initialized once
and then do not change.
Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent ca97d939
...@@ -28,7 +28,7 @@ struct nlmsg_perm { ...@@ -28,7 +28,7 @@ struct nlmsg_perm {
u32 perm; u32 perm;
}; };
static struct nlmsg_perm nlmsg_route_perms[] = static const struct nlmsg_perm nlmsg_route_perms[] =
{ {
{ RTM_NEWLINK, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, { RTM_NEWLINK, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
{ RTM_DELLINK, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, { RTM_DELLINK, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
...@@ -80,7 +80,7 @@ static struct nlmsg_perm nlmsg_route_perms[] = ...@@ -80,7 +80,7 @@ static struct nlmsg_perm nlmsg_route_perms[] =
{ RTM_GETSTATS, NETLINK_ROUTE_SOCKET__NLMSG_READ }, { RTM_GETSTATS, NETLINK_ROUTE_SOCKET__NLMSG_READ },
}; };
static struct nlmsg_perm nlmsg_tcpdiag_perms[] = static const struct nlmsg_perm nlmsg_tcpdiag_perms[] =
{ {
{ TCPDIAG_GETSOCK, NETLINK_TCPDIAG_SOCKET__NLMSG_READ }, { TCPDIAG_GETSOCK, NETLINK_TCPDIAG_SOCKET__NLMSG_READ },
{ DCCPDIAG_GETSOCK, NETLINK_TCPDIAG_SOCKET__NLMSG_READ }, { DCCPDIAG_GETSOCK, NETLINK_TCPDIAG_SOCKET__NLMSG_READ },
...@@ -88,7 +88,7 @@ static struct nlmsg_perm nlmsg_tcpdiag_perms[] = ...@@ -88,7 +88,7 @@ static struct nlmsg_perm nlmsg_tcpdiag_perms[] =
{ SOCK_DESTROY, NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE }, { SOCK_DESTROY, NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE },
}; };
static struct nlmsg_perm nlmsg_xfrm_perms[] = static const struct nlmsg_perm nlmsg_xfrm_perms[] =
{ {
{ XFRM_MSG_NEWSA, NETLINK_XFRM_SOCKET__NLMSG_WRITE }, { XFRM_MSG_NEWSA, NETLINK_XFRM_SOCKET__NLMSG_WRITE },
{ XFRM_MSG_DELSA, NETLINK_XFRM_SOCKET__NLMSG_WRITE }, { XFRM_MSG_DELSA, NETLINK_XFRM_SOCKET__NLMSG_WRITE },
...@@ -115,7 +115,7 @@ static struct nlmsg_perm nlmsg_xfrm_perms[] = ...@@ -115,7 +115,7 @@ static struct nlmsg_perm nlmsg_xfrm_perms[] =
{ XFRM_MSG_MAPPING, NETLINK_XFRM_SOCKET__NLMSG_READ }, { XFRM_MSG_MAPPING, NETLINK_XFRM_SOCKET__NLMSG_READ },
}; };
static struct nlmsg_perm nlmsg_audit_perms[] = static const struct nlmsg_perm nlmsg_audit_perms[] =
{ {
{ AUDIT_GET, NETLINK_AUDIT_SOCKET__NLMSG_READ }, { AUDIT_GET, NETLINK_AUDIT_SOCKET__NLMSG_READ },
{ AUDIT_SET, NETLINK_AUDIT_SOCKET__NLMSG_WRITE }, { AUDIT_SET, NETLINK_AUDIT_SOCKET__NLMSG_WRITE },
...@@ -136,7 +136,7 @@ static struct nlmsg_perm nlmsg_audit_perms[] = ...@@ -136,7 +136,7 @@ static struct nlmsg_perm nlmsg_audit_perms[] =
}; };
static int nlmsg_perm(u16 nlmsg_type, u32 *perm, struct nlmsg_perm *tab, size_t tabsize) static int nlmsg_perm(u16 nlmsg_type, u32 *perm, const struct nlmsg_perm *tab, size_t tabsize)
{ {
int i, err = -EINVAL; int i, err = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment