diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 3578357abe30..5f9b102c3b55 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2666,7 +2666,7 @@ static void tcp_process_loss(struct sock *sk, int flag, int num_dupack, | |||
2666 | struct tcp_sock *tp = tcp_sk(sk); | 2666 | struct tcp_sock *tp = tcp_sk(sk); |
2667 | bool recovered = !before(tp->snd_una, tp->high_seq); | 2667 | bool recovered = !before(tp->snd_una, tp->high_seq); |
2668 | 2668 | ||
2669 | if ((flag & FLAG_SND_UNA_ADVANCED || tp->fastopen_rsk) && | 2669 | if ((flag & FLAG_SND_UNA_ADVANCED || rcu_access_pointer(tp->fastopen_rsk)) && |
2670 | tcp_try_undo_loss(sk, false)) | 2670 | tcp_try_undo_loss(sk, false)) |
2671 | return; | 2671 | return; |
2672 | 2672 | ||
@@ -2990,7 +2990,7 @@ void tcp_rearm_rto(struct sock *sk) | |||
2990 | /* If the retrans timer is currently being used by Fast Open | 2990 | /* If the retrans timer is currently being used by Fast Open |
2991 | * for SYN-ACK retrans purpose, stay put. | 2991 | * for SYN-ACK retrans purpose, stay put. |
2992 | */ | 2992 | */ |
2993 | if (tp->fastopen_rsk) | 2993 | if (rcu_access_pointer(tp->fastopen_rsk)) |
2994 | return; | 2994 | return; |
2995 | 2995 | ||
2996 | if (!tp->packets_out) { | 2996 | if (!tp->packets_out) { |
@@ -6087,6 +6087,8 @@ reset_and_undo: | |||
6087 | 6087 | ||
6088 | static void tcp_rcv_synrecv_state_fastopen(struct sock *sk) | 6088 | static void tcp_rcv_synrecv_state_fastopen(struct sock *sk) |
6089 | { | 6089 | { |
6090 | struct request_sock *req; | ||
6091 | |||
6090 | tcp_try_undo_loss(sk, false); | 6092 | tcp_try_undo_loss(sk, false); |
6091 | 6093 | ||
6092 | /* Reset rtx states to prevent spurious retransmits_timed_out() */ | 6094 | /* Reset rtx states to prevent spurious retransmits_timed_out() */ |
@@ -6096,7 +6098,9 @@ static void tcp_rcv_synrecv_state_fastopen(struct sock *sk) | |||
6096 | /* Once we leave TCP_SYN_RECV or TCP_FIN_WAIT_1, | 6098 | /* Once we leave TCP_SYN_RECV or TCP_FIN_WAIT_1, |
6097 | * we no longer need req so release it. | 6099 | * we no longer need req so release it. |
6098 | */ | 6100 | */ |
6099 | reqsk_fastopen_remove(sk, tcp_sk(sk)->fastopen_rsk, false); | 6101 | req = rcu_dereference_protected(tcp_sk(sk)->fastopen_rsk, |
6102 | lockdep_sock_is_held(sk)); | ||
6103 | reqsk_fastopen_remove(sk, req, false); | ||
6100 | 6104 | ||
6101 | /* Re-arm the timer because data may have been sent out. | 6105 | /* Re-arm the timer because data may have been sent out. |
6102 | * This is similar to the regular data transmission case | 6106 | * This is similar to the regular data transmission case |
@@ -6171,7 +6175,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) | |||
6171 | 6175 | ||
6172 | tcp_mstamp_refresh(tp); | 6176 | tcp_mstamp_refresh(tp); |
6173 | tp->rx_opt.saw_tstamp = 0; | 6177 | tp->rx_opt.saw_tstamp = 0; |
6174 | req = tp->fastopen_rsk; | 6178 | req = rcu_dereference_protected(tp->fastopen_rsk, |
6179 | lockdep_sock_is_held(sk)); | ||
6175 | if (req) { | 6180 | if (req) { |
6176 | bool req_stolen; | 6181 | bool req_stolen; |
6177 | 6182 | ||