aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/af_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r--net/netlink/af_netlink.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 1d5905c90cd4..733bf52cef3e 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -21,7 +21,6 @@
21 21
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/major.h>
25#include <linux/signal.h> 24#include <linux/signal.h>
26#include <linux/sched.h> 25#include <linux/sched.h>
27#include <linux/errno.h> 26#include <linux/errno.h>
@@ -50,6 +49,8 @@
50#include <linux/bitops.h> 49#include <linux/bitops.h>
51#include <linux/mm.h> 50#include <linux/mm.h>
52#include <linux/types.h> 51#include <linux/types.h>
52#include <linux/audit.h>
53
53#include <net/sock.h> 54#include <net/sock.h>
54#include <net/scm.h> 55#include <net/scm.h>
55 56
@@ -374,7 +375,6 @@ static int netlink_release(struct socket *sock)
374 nlk->cb->done(nlk->cb); 375 nlk->cb->done(nlk->cb);
375 netlink_destroy_callback(nlk->cb); 376 netlink_destroy_callback(nlk->cb);
376 nlk->cb = NULL; 377 nlk->cb = NULL;
377 __sock_put(sk);
378 } 378 }
379 spin_unlock(&nlk->cb_lock); 379 spin_unlock(&nlk->cb_lock);
380 380
@@ -906,6 +906,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
906 NETLINK_CB(skb).groups = nlk->groups; 906 NETLINK_CB(skb).groups = nlk->groups;
907 NETLINK_CB(skb).dst_pid = dst_pid; 907 NETLINK_CB(skb).dst_pid = dst_pid;
908 NETLINK_CB(skb).dst_groups = dst_groups; 908 NETLINK_CB(skb).dst_groups = dst_groups;
909 NETLINK_CB(skb).loginuid = audit_get_loginuid(current->audit_context);
909 memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred)); 910 memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
910 911
911 /* What can I do? Netlink is asynchronous, so that 912 /* What can I do? Netlink is asynchronous, so that
@@ -1100,7 +1101,6 @@ static int netlink_dump(struct sock *sk)
1100 spin_unlock(&nlk->cb_lock); 1101 spin_unlock(&nlk->cb_lock);
1101 1102
1102 netlink_destroy_callback(cb); 1103 netlink_destroy_callback(cb);
1103 __sock_put(sk);
1104 return 0; 1104 return 0;
1105} 1105}
1106 1106
@@ -1139,7 +1139,6 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1139 return -EBUSY; 1139 return -EBUSY;
1140 } 1140 }
1141 nlk->cb = cb; 1141 nlk->cb = cb;
1142 sock_hold(sk);
1143 spin_unlock(&nlk->cb_lock); 1142 spin_unlock(&nlk->cb_lock);
1144 1143
1145 netlink_dump(sk); 1144 netlink_dump(sk);