]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/netlink/af_netlink.c
[PATCH] Reworked patch for labels on user space messages
[net-next-2.6.git] / net / netlink / af_netlink.c
index 2a233ffcf6182008ba0dfbccb06eb28f559ff77d..09fbc4bc7088fa2437a4727f9a3046fbc4045185 100644 (file)
@@ -56,6 +56,7 @@
 #include <linux/mm.h>
 #include <linux/types.h>
 #include <linux/audit.h>
+#include <linux/selinux.h>
 
 #include <net/sock.h>
 #include <net/scm.h>
@@ -1157,6 +1158,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
        NETLINK_CB(skb).dst_pid = dst_pid;
        NETLINK_CB(skb).dst_group = dst_group;
        NETLINK_CB(skb).loginuid = audit_get_loginuid(current->audit_context);
+       selinux_get_task_sid(current, &(NETLINK_CB(skb).sid));
        memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
 
        /* What can I do? Netlink is asynchronous, so that