Skip to content

Commit dd5684e

Browse files
akodanevdavem330
authored andcommitted
dccp: don't restart ccid2_hc_tx_rto_expire() if sk in closed state
ccid2_hc_tx_rto_expire() timer callback always restarts the timer again and can run indefinitely (unless it is stopped outside), and after commit 120e9da ("dccp: defer ccid_hc_tx_delete() at dismantle time"), which moved ccid_hc_tx_delete() (also includes sk_stop_timer()) from dccp_destroy_sock() to sk_destruct(), this started to happen quite often. The timer prevents releasing the socket, as a result, sk_destruct() won't be called. Found with LTP/dccp_ipsec tests running on the bonding device, which later couldn't be unloaded after the tests were completed: unregister_netdevice: waiting for bond0 to become free. Usage count = 148 Fixes: 2a91aa3 ("[DCCP] CCID2: Initial CCID2 (TCP-Like) implementation") Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1e19c4d commit dd5684e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/dccp/ccids/ccid2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ static void ccid2_hc_tx_rto_expire(struct timer_list *t)
140140

141141
ccid2_pr_debug("RTO_EXPIRE\n");
142142

143+
if (sk->sk_state == DCCP_CLOSED)
144+
goto out;
145+
143146
/* back-off timer */
144147
hc->tx_rto <<= 1;
145148
if (hc->tx_rto > DCCP_RTO_MAX)

0 commit comments

Comments
 (0)