mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
netlink: avoid a double skb free in genlmsg_mcast()
[ Upstream commit02a2385f37] 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2980f37b61
commit
06d3f43d52
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user