Subject: Regression with commit 971f10eca186 ("tcp: better TCP_SKB_CB layout to reduce cache line misses")

From: Nicolas Dichtel <[email-masked]>
Date: Mon, 22 Dec 2014 16:17:38 +0100

One of our engineer (Huaibin Wang <[email-masked]>) has reported and
analysed this bug:

This commit introduces a regression with IPv6 + IPsec transport + TCP.

In TCP (net/ipv6/tcp_ipv6.c), xfrm6_policy_check() is called and thus, after
some intermediate functions, _decode_session6() is also called.

This function uses IP6CB() (u8 nexthdr = nh[IP6CB(skb)->nhoff]), which is wrong
becauses it has been moved to the end of TCP_SKB_CB().

Not sure what is the best way to fix this, any suggestion?

Regards,
Nicolas