]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - security/selinux/netlink.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
[karo-tx-linux.git] / security / selinux / netlink.c
index 8a77725423e0848e671a1f5bdb021fa414de6059..828fb6a4e9410e6a0bae91c2126a7645db4f4daa 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/export.h>
 #include <linux/skbuff.h>
-#include <linux/netlink.h>
 #include <linux/selinux_netlink.h>
 #include <net/net_namespace.h>
 #include <net/netlink.h>
@@ -77,7 +76,7 @@ static void selnl_notify(int msgtype, void *data)
 
        len = selnl_msglen(msgtype);
 
-       skb = alloc_skb(NLMSG_SPACE(len), GFP_USER);
+       skb = nlmsg_new(len, GFP_USER);
        if (!skb)
                goto oom;
 
@@ -113,13 +112,12 @@ static int __init selnl_init(void)
 {
        struct netlink_kernel_cfg cfg = {
                .groups = SELNLGRP_MAX,
+               .flags  = NL_CFG_F_NONROOT_RECV,
        };
 
-       selnl = netlink_kernel_create(&init_net, NETLINK_SELINUX,
-                                     THIS_MODULE, &cfg);
+       selnl = netlink_kernel_create(&init_net, NETLINK_SELINUX, &cfg);
        if (selnl == NULL)
                panic("SELinux:  Cannot create netlink socket.");
-       netlink_set_nonroot(NETLINK_SELINUX, NL_NONROOT_RECV);
        return 0;
 }