Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv4: call __ip_options_echo() in cookie_v4_check()

commit 971f10eca186cab238c49da ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
missed that cookie_v4_check() still calls ip_options_echo() which uses
IPCB(). It should use TCPCB() at TCP layer, so call __ip_options_echo()
instead.

Fixes: commit 971f10eca186cab238c49da ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
Cc: Krzysztof Kolasa <kkolasa@winsoft.pl>
Cc: Eric Dumazet <edumazet@google.com>
Reported-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
Tested-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Cong Wang and committed by
David S. Miller
2077eebf b7983e3f

+1 -1
+1 -1
net/ipv4/syncookies.c
··· 321 321 int opt_size = sizeof(struct ip_options_rcu) + opt->optlen; 322 322 323 323 ireq->opt = kmalloc(opt_size, GFP_ATOMIC); 324 - if (ireq->opt != NULL && ip_options_echo(&ireq->opt->opt, skb)) { 324 + if (ireq->opt != NULL && __ip_options_echo(&ireq->opt->opt, skb, opt)) { 325 325 kfree(ireq->opt); 326 326 ireq->opt = NULL; 327 327 }