WSL2-Linux-Kernel/net/ipv6
Vasily Averin 5796015fa9 ipv6: allocate enough headroom in ip6_finish_output2()
When TEE target mirrors traffic to another interface, sk_buff may
not have enough headroom to be processed correctly.
ip_finish_output2() detect this situation for ipv4 and allocates
new skb with enogh headroom. However ipv6 lacks this logic in
ip_finish_output2 and it leads to skb_under_panic:

 skbuff: skb_under_panic: text:ffffffffc0866ad4 len:96 put:24
 head:ffff97be85e31800 data:ffff97be85e317f8 tail:0x58 end:0xc0 dev:gre0
 ------------[ cut here ]------------
 kernel BUG at net/core/skbuff.c:110!
 invalid opcode: 0000 [#1] SMP PTI
 CPU: 2 PID: 393 Comm: kworker/2:2 Tainted: G           OE     5.13.0 #13
 Hardware name: Virtuozzo KVM, BIOS 1.11.0-2.vz7.4 04/01/2014
 Workqueue: ipv6_addrconf addrconf_dad_work
 RIP: 0010:skb_panic+0x48/0x4a
 Call Trace:
  skb_push.cold.111+0x10/0x10
  ipgre_header+0x24/0xf0 [ip_gre]
  neigh_connected_output+0xae/0xf0
  ip6_finish_output2+0x1a8/0x5a0
  ip6_output+0x5c/0x110
  nf_dup_ipv6+0x158/0x1000 [nf_dup_ipv6]
  tee_tg6+0x2e/0x40 [xt_TEE]
  ip6t_do_table+0x294/0x470 [ip6_tables]
  nf_hook_slow+0x44/0xc0
  nf_hook.constprop.34+0x72/0xe0
  ndisc_send_skb+0x20d/0x2e0
  ndisc_send_ns+0xd1/0x210
  addrconf_dad_work+0x3c8/0x540
  process_one_work+0x1d1/0x370
  worker_thread+0x30/0x390
  kthread+0x116/0x130
  ret_from_fork+0x22/0x30

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-12 11:25:12 -07:00
..
ila
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
Kconfig
Makefile
addrconf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
addrconf_core.c
addrlabel.c
af_inet6.c
ah6.c xfrm: remove hdr_offset indirection 2021-06-11 14:48:50 +02:00
anycast.c
calipso.c
datagram.c
esp6.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-29 15:45:27 -07:00
esp6_offload.c xfrm: remove description from xfrm_type struct 2021-06-09 09:38:52 +02:00
exthdrs.c ipv6: fix out-of-bound access in ip6_parse_tlv() 2021-06-24 12:42:57 -07:00
exthdrs_core.c
exthdrs_offload.c
fib6_notifier.c
fib6_rules.c ipv6: fib6: remove redundant initialization of variable err 2021-06-14 12:42:26 -07:00
fou6.c
icmp.c ipv6: ICMPV6: add response to ICMPV6 RFC 8335 PROBE messages 2021-06-28 14:29:45 -07:00
inet6_connection_sock.c
inet6_hashtables.c
ip6_checksum.c
ip6_fib.c
ip6_flowlabel.c
ip6_gre.c
ip6_icmp.c
ip6_input.c
ip6_offload.c
ip6_offload.h
ip6_output.c ipv6: allocate enough headroom in ip6_finish_output2() 2021-07-12 11:25:12 -07:00
ip6_tunnel.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-29 15:45:27 -07:00
ip6_udp_tunnel.c
ip6_vti.c
ip6mr.c
ipcomp6.c xfrm: remove hdr_offset indirection 2021-06-11 14:48:50 +02:00
ipv6_sockglue.c
mcast.c mld: avoid unnecessary high order page allocation in mld_newpack() 2021-06-14 12:46:00 -07:00
mcast_snoop.c
mip6.c xfrm: ipv6: move mip6_rthdr_offset into xfrm core 2021-06-11 14:48:50 +02:00
ndisc.c
netfilter.c
output_core.c
ping.c
proc.c
protocol.c
raw.c net: sock: introduce sk_error_report 2021-06-29 11:28:21 -07:00
reassembly.c
route.c
rpl.c
rpl_iptunnel.c
seg6.c
seg6_hmac.c
seg6_iptunnel.c
seg6_local.c seg6: add support for SRv6 End.DT46 Behavior 2021-06-18 11:35:47 -07:00
sit.c sit: allow redirecting ip6ip, ipip and mplsip packets to eth devices 2021-06-28 12:44:17 -07:00
syncookies.c
sysctl_net_ipv6.c
tcp_ipv6.c net: send SYNACK packet with accepted fwmark 2021-07-09 11:24:02 -07:00
tcpv6_offload.c
tunnel6.c
udp.c udp: annotate data races around unix_sk(sk)->gso_size 2021-07-01 13:23:19 -07:00
udp_impl.h
udp_offload.c
udplite.c
xfrm6_input.c
xfrm6_output.c net: ipv6: fix return value of ip6_skb_dst_mtu 2021-07-02 11:57:01 -07:00
xfrm6_policy.c
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c xfrm: remove description from xfrm_type struct 2021-06-09 09:38:52 +02:00