mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	[SCTP]: Fix potential NULL pointer dereference in sctp_v4_get_saddr
It is possible to get to sctp_v4_get_saddr() without a valid association. This happens when processing OOTB packets and the cached route entry is no longer valid. However, when responding to OOTB packets we already properly set the source address based on the information in the OOTB packet. So, if we we get to sctp_v4_get_saddr() without an association we can simply return. Signed-off-by: Vladislav Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									8eb5591052
								
							
						
					
					
						commit
						23ec47a088
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -530,6 +530,9 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc, | |||
| { | ||||
| 	struct rtable *rt = (struct rtable *)dst; | ||||
| 
 | ||||
| 	if (!asoc) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (rt) { | ||||
| 		saddr->v4.sin_family = AF_INET; | ||||
| 		saddr->v4.sin_port = asoc->base.bind_addr.port;   | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Vladislav Yasevich
						Vladislav Yasevich