mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	net: netlink: catch attempts to send empty messages
syzbot can figure out a way to redirect a netlink message to a tap. Sending empty skbs to devices is not valid and we end up hitting a skb_assert_len() in __dev_queue_xmit(). Make catching these mistakes easier, assert the skb size directly in netlink core. Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20241218024400.824355-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
		
							parent
							
								
									3fc87cb94f
								
							
						
					
					
						commit
						75e2c86c7b
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		|  | @ -1287,6 +1287,7 @@ static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation) | |||
| { | ||||
| 	int delta; | ||||
| 
 | ||||
| 	skb_assert_len(skb); | ||||
| 	WARN_ON(skb->sk != NULL); | ||||
| 	delta = skb->end - skb->tail; | ||||
| 	if (is_vmalloc_addr(skb->head) || delta * 2 < skb->truesize) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jakub Kicinski
						Jakub Kicinski