tcp/dccp: fix ireq->opt races
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / net / ipv4 / syncookies.c
index 731b91409625cd27ed9b10a792d7165177694c34..c22a74374a9c7ea17c49837554689812b592e3f4 100644 (file)
@@ -357,7 +357,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
        /* We throwed the options of the initial SYN away, so we hope
         * the ACK carries the same options again (see RFC1122 4.2.3.8)
         */
-       ireq->opt = tcp_v4_save_options(skb);
+       RCU_INIT_POINTER(ireq->ireq_opt, tcp_v4_save_options(skb));
 
        if (security_inet_conn_request(sk, skb, req)) {
                reqsk_free(req);