mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	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: 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>
			
			
This commit is contained in:
		
							parent
							
								
									4609adc271
								
							
						
					
					
						commit
						02a2385f37
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -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);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue