summaryrefslogtreecommitdiff
path: root/net/netlink
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2018-03-14 23:10:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-08 12:49:42 +0300
commitb22ad56cce33e45dbfa19b41c4d7368a5bf34bde (patch)
treeeacabc4a2855b367a1cc9ced240eca3a3358c474 /net/netlink
parenta6ca1eddd279cb9bebf83f4473e347a540f3b442 (diff)
downloadlinux-b22ad56cce33e45dbfa19b41c4d7368a5bf34bde.tar.xz
netlink: avoid a double skb free in genlmsg_mcast()
[ Upstream commit 02a2385f37a7c6594c9d89b64c4a1451276f08eb ] 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/genetlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index f20774e4e0d5..bb263c1c1433 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -1083,7 +1083,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);