mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	dccp: CVE-2017-8824: use-after-free in DCCP code
Whenever the sock object is in DCCP_CLOSED state, dccp_disconnect() must free dccps_hc_tx_ccid and dccps_hc_rx_ccid and set to NULL. Signed-off-by: Mohamed Ghannam <simo.ghannam@gmail.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									d7efc6c11b
								
							
						
					
					
						commit
						69c64866ce
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -259,6 +259,7 @@ int dccp_disconnect(struct sock *sk, int flags)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct inet_connection_sock *icsk = inet_csk(sk);
 | 
						struct inet_connection_sock *icsk = inet_csk(sk);
 | 
				
			||||||
	struct inet_sock *inet = inet_sk(sk);
 | 
						struct inet_sock *inet = inet_sk(sk);
 | 
				
			||||||
 | 
						struct dccp_sock *dp = dccp_sk(sk);
 | 
				
			||||||
	int err = 0;
 | 
						int err = 0;
 | 
				
			||||||
	const int old_state = sk->sk_state;
 | 
						const int old_state = sk->sk_state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -278,6 +279,10 @@ int dccp_disconnect(struct sock *sk, int flags)
 | 
				
			||||||
		sk->sk_err = ECONNRESET;
 | 
							sk->sk_err = ECONNRESET;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dccp_clear_xmit_timers(sk);
 | 
						dccp_clear_xmit_timers(sk);
 | 
				
			||||||
 | 
						ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
 | 
				
			||||||
 | 
						ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
 | 
				
			||||||
 | 
						dp->dccps_hc_rx_ccid = NULL;
 | 
				
			||||||
 | 
						dp->dccps_hc_tx_ccid = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	__skb_queue_purge(&sk->sk_receive_queue);
 | 
						__skb_queue_purge(&sk->sk_receive_queue);
 | 
				
			||||||
	__skb_queue_purge(&sk->sk_write_queue);
 | 
						__skb_queue_purge(&sk->sk_write_queue);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue