Commit 335079e8 authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by Greg Kroah-Hartman

netlink: avoid a double skb free in genlmsg_mcast()


[ Upstream commit 02a2385f ]

nlmsg_multicast() consumes always the skb, thus the original skb must be
freed only when this function is called with a clone.

Fixes: cb9f7a9a ("netlink: ensure to loop over all netns in genlmsg_multicast_allns()")
Reported-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 800c5054
...@@ -1143,7 +1143,7 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group, ...@@ -1143,7 +1143,7 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group,
if (!err) if (!err)
delivered = true; delivered = true;
else if (err != -ESRCH) else if (err != -ESRCH)
goto error; return err;
return delivered ? 0 : -ESRCH; return delivered ? 0 : -ESRCH;
error: error:
kfree_skb(skb); kfree_skb(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment