aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c59d0bd29c5c..883ee863db43 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -477,7 +477,7 @@ static void tcp_tx_timestamp(struct sock *sk, u16 tsflags)
477static inline bool tcp_stream_is_readable(const struct tcp_sock *tp, 477static inline bool tcp_stream_is_readable(const struct tcp_sock *tp,
478 int target, struct sock *sk) 478 int target, struct sock *sk)
479{ 479{
480 return (tp->rcv_nxt - tp->copied_seq >= target) || 480 return (READ_ONCE(tp->rcv_nxt) - tp->copied_seq >= target) ||
481 (sk->sk_prot->stream_memory_read ? 481 (sk->sk_prot->stream_memory_read ?
482 sk->sk_prot->stream_memory_read(sk) : false); 482 sk->sk_prot->stream_memory_read(sk) : false);
483} 483}
@@ -2935,7 +2935,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
2935 else if (tp->repair_queue == TCP_SEND_QUEUE) 2935 else if (tp->repair_queue == TCP_SEND_QUEUE)
2936 tp->write_seq = val; 2936 tp->write_seq = val;
2937 else if (tp->repair_queue == TCP_RECV_QUEUE) 2937 else if (tp->repair_queue == TCP_RECV_QUEUE)
2938 tp->rcv_nxt = val; 2938 WRITE_ONCE(tp->rcv_nxt, val);
2939 else 2939 else
2940 err = -EINVAL; 2940 err = -EINVAL;
2941 break; 2941 break;