mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	tipc: fix a missing check of genlmsg_put
genlmsg_put could fail. The fix inserts a check of its return value, and if it fails, returns -EMSGSIZE. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									ff07d48d7b
								
							
						
					
					
						commit
						46273cf7e0
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -904,6 +904,8 @@ static int tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, u32 sock)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hdr = genlmsg_put(args, 0, 0, &tipc_genl_family, NLM_F_MULTI,
 | 
						hdr = genlmsg_put(args, 0, 0, &tipc_genl_family, NLM_F_MULTI,
 | 
				
			||||||
			  TIPC_NL_PUBL_GET);
 | 
								  TIPC_NL_PUBL_GET);
 | 
				
			||||||
 | 
						if (!hdr)
 | 
				
			||||||
 | 
							return -EMSGSIZE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	nest = nla_nest_start(args, TIPC_NLA_SOCK);
 | 
						nest = nla_nest_start(args, TIPC_NLA_SOCK);
 | 
				
			||||||
	if (!nest) {
 | 
						if (!nest) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue