aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso2012-06-29 01:15:21 -0500
committerDavid S. Miller2012-06-29 18:46:02 -0500
commita31f2d17b331db970259e875b7223d3aba7e3821 (patch)
tree0d10021be81446ab360f4240b0d16729f518387f /security/selinux
parentdd7f36ba3ce17d4fe85987d83efd5901b0935816 (diff)
downloadam43-linux-kernel-a31f2d17b331db970259e875b7223d3aba7e3821.tar.gz
am43-linux-kernel-a31f2d17b331db970259e875b7223d3aba7e3821.tar.xz
am43-linux-kernel-a31f2d17b331db970259e875b7223d3aba7e3821.zip
netlink: add netlink_kernel_cfg parameter to netlink_kernel_create
This patch adds the following structure: struct netlink_kernel_cfg { unsigned int groups; void (*input)(struct sk_buff *skb); struct mutex *cb_mutex; }; That can be passed to netlink_kernel_create to set optional configurations for netlink kernel sockets. I've populated this structure by looking for NULL and zero parameters at the existing code. The remaining parameters that always need to be set are still left in the original interface. That includes optional parameters for the netlink socket creation. This allows easy extensibility of this interface in the future. This patch also adapts all callers to use this new interface. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/netlink.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/security/selinux/netlink.c b/security/selinux/netlink.c
index 8a23a35b9c5..8a77725423e 100644
--- a/security/selinux/netlink.c
+++ b/security/selinux/netlink.c
@@ -111,8 +111,12 @@ void selnl_notify_policyload(u32 seqno)
111 111
112static int __init selnl_init(void) 112static int __init selnl_init(void)
113{ 113{
114 struct netlink_kernel_cfg cfg = {
115 .groups = SELNLGRP_MAX,
116 };
117
114 selnl = netlink_kernel_create(&init_net, NETLINK_SELINUX, 118 selnl = netlink_kernel_create(&init_net, NETLINK_SELINUX,
115 SELNLGRP_MAX, NULL, NULL, THIS_MODULE); 119 THIS_MODULE, &cfg);
116 if (selnl == NULL) 120 if (selnl == NULL)
117 panic("SELinux: Cannot create netlink socket."); 121 panic("SELinux: Cannot create netlink socket.");
118 netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV); 122 netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV);