提交 02a2385f 编写于 作者: N Nicolas Dichtel 提交者: David S. Miller

netlink: avoid a double skb free in genlmsg_mcast()

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: NBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4609adc2
...@@ -1106,7 +1106,7 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group, ...@@ -1106,7 +1106,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册