]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/ipv4/tcp_input.c
tcp/dccp: fix ireq->opt races
[mirror_ubuntu-artful-kernel.git] / net / ipv4 / tcp_input.c
index 53de1424c13cda5d1fec826b97cacf4f95adc99a..e92e5dbcb3d622378492e8d06f31aa26f3cccde1 100644 (file)
@@ -3009,8 +3009,7 @@ void tcp_rearm_rto(struct sock *sk)
                        /* delta_us may not be positive if the socket is locked
                         * when the retrans timer fires and is rescheduled.
                         */
-                       if (delta_us > 0)
-                               rto = usecs_to_jiffies(delta_us);
+                       rto = usecs_to_jiffies(max_t(int, delta_us, 1));
                }
                inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto,
                                          TCP_RTO_MAX);
@@ -6236,7 +6235,7 @@ struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
                struct inet_request_sock *ireq = inet_rsk(req);
 
                kmemcheck_annotate_bitfield(ireq, flags);
-               ireq->opt = NULL;
+               ireq->ireq_opt = NULL;
 #if IS_ENABLED(CONFIG_IPV6)
                ireq->pktopts = NULL;
 #endif