From: Eric Dumazet <hidden> Date: 2021-11-19 01:38:03
From: Eric Dumazet <edumazet@google.com>
We deal with IPv6 packets, so we need to use IP6CB(skb)->flags and
IP6SKB_REROUTED, instead of IPCB(skb)->flags and IPSKB_REROUTED
Found by code inspection, please double check that fixing this bug
does not surface other bugs.
Fixes: 09ee9dba9611 ("ipv6: Reinject IPv6 packets if IPsec policy matches after SNAT")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tobias Brunner <redacted>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: David Ahern <dsahern@kernel.org>
---
net/ipv6/ip6_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: David Ahern <hidden> Date: 2021-11-19 03:48:20
On 11/18/21 6:37 PM, Eric Dumazet wrote:
quoted hunk
From: Eric Dumazet <edumazet@google.com>
We deal with IPv6 packets, so we need to use IP6CB(skb)->flags and
IP6SKB_REROUTED, instead of IPCB(skb)->flags and IPSKB_REROUTED
Found by code inspection, please double check that fixing this bug
does not surface other bugs.
Fixes: 09ee9dba9611 ("ipv6: Reinject IPv6 packets if IPsec policy matches after SNAT")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tobias Brunner <redacted>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: David Ahern <dsahern@kernel.org>
---
net/ipv6/ip6_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -174,7 +174,7 @@ static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff#if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM)/* Policy lookup after SNAT yielded a new policy */if(skb_dst(skb)->xfrm){-IPCB(skb)->flags|=IPSKB_REROUTED;+IP6CB(skb)->flags|=IP6SKB_REROUTED;returndst_output(net,sk,skb);}#endif
How did that even work - the flags are at different offsets.
VRF driver has the same mistake in vrf_output6_direct (I followed ipv6
code back when and did not pick up on the mistake). prepare_ipv6_hdr in
rxe_net.c has a similar style mistake.
Reviewed-by: David Ahern <dsahern@kernel.org>
From: Eric Dumazet <edumazet@google.com>
We deal with IPv6 packets, so we need to use IP6CB(skb)->flags and
IP6SKB_REROUTED, instead of IPCB(skb)->flags and IPSKB_REROUTED
Found by code inspection, please double check that fixing this bug
does not surface other bugs.
Fixes: 09ee9dba9611 ("ipv6: Reinject IPv6 packets if IPsec policy matches after SNAT")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tobias Brunner <redacted>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: David Ahern <dsahern@kernel.org>
---
net/ipv6/ip6_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:
On Thu, 18 Nov 2021 17:37:58 -0800 you wrote:
From: Eric Dumazet <edumazet@google.com>
We deal with IPv6 packets, so we need to use IP6CB(skb)->flags and
IP6SKB_REROUTED, instead of IPCB(skb)->flags and IPSKB_REROUTED
Found by code inspection, please double check that fixing this bug
does not surface other bugs.
[...]