1
0
Fork 0

netlink: avoid a double skb free in genlmsg_mcast()

[ Upstream commit 02a2385f37 ]

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

Fixes: cb9f7a9a5c ("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>
pull/10/head
Nicolas Dichtel 2018-03-14 21:10:23 +01:00 committed by Greg Kroah-Hartman
parent 2980f37b61
commit 06d3f43d52
1 changed files with 1 additions and 1 deletions

View File

@ -1106,7 +1106,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);