mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-18 22:14:16 +00:00 
			
		
		
		
	ethtool: tunnels: check the return value of nla_nest_start()
Check the return value of nla_nest_start(). When starting the entry level nested attributes, if the tailroom of socket buffer is insufficient to store the attribute header and payload, the return value will be NULL. There is, however, no real bug here since if the skb is full nla_put_be16() will fail as well and we'll error out. Signed-off-by: Li Zhong <floridsleeves@gmail.com> Link: https://lore.kernel.org/r/20220921181716.1629541-1-floridsleeves@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
		
							parent
							
								
									97cfede0d1
								
							
						
					
					
						commit
						05cd823863
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -136,6 +136,8 @@ ethnl_tunnel_info_fill_reply(const struct ethnl_req_info *req_base, | ||||||
| 			goto err_cancel_table; | 			goto err_cancel_table; | ||||||
| 
 | 
 | ||||||
| 		entry = nla_nest_start(skb, ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY); | 		entry = nla_nest_start(skb, ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY); | ||||||
|  | 		if (!entry) | ||||||
|  | 			goto err_cancel_entry; | ||||||
| 
 | 
 | ||||||
| 		if (nla_put_be16(skb, ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT, | 		if (nla_put_be16(skb, ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT, | ||||||
| 				 htons(IANA_VXLAN_UDP_PORT)) || | 				 htons(IANA_VXLAN_UDP_PORT)) || | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Li Zhong
						Li Zhong