diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2018-03-14 21:10:23 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-06-16 22:22:11 +0100 |
commit | 3f5a898f9e6c881d9cdd74b514fb54144243f4cd (patch) | |
tree | 17d25a1aca3b96feff67370b2094c707035d6357 /net/netlink | |
parent | 8ac2414ffd89c62c894bf67581570d5c4d9cfec0 (diff) | |
download | linux-stable-3f5a898f9e6c881d9cdd74b514fb54144243f4cd.tar.gz linux-stable-3f5a898f9e6c881d9cdd74b514fb54144243f4cd.tar.bz2 linux-stable-3f5a898f9e6c881d9cdd74b514fb54144243f4cd.zip |
netlink: avoid a double skb free in genlmsg_mcast()
commit 02a2385f37a7c6594c9d89b64c4a1451276f08eb upstream.
nlmsg_multicast() consumes always the skb, thus the original skb must be
freed only when this function is called with a clone.
Fixes: cb9f7a9a5c96 ("netlink: ensure to loop over all netns in genlmsg_multicast_allns()")
Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/genetlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 0a26d713ebd0..e2da52eeafd2 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -1067,7 +1067,7 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group, if (!err) delivered = true; else if (err != -ESRCH) - goto error; + return err; return delivered ? 0 : -ESRCH; error: kfree_skb(skb); |