linux/net/ipv6
Jakub Sitnicki 3ba3458fb9 ipv6: Count in extension headers in skb->network_header
When sending a UDPv6 message longer than MTU, account for the length
of fragmentable IPv6 extension headers in skb->network_header offset.
Same as we do in alloc_new_skb path in __ip6_append_data().

This ensures that later on __ip6_make_skb() will make space in
headroom for fragmentable extension headers:

	/* move skb->data to ip header from ext header */
	if (skb->data < skb_network_header(skb))
		__skb_pull(skb, skb_network_offset(skb));

Prevents a splat due to skb_under_panic:

skbuff: skb_under_panic: text:ffffffff8143397b len:2126 put:14 \
head:ffff880005bacf50 data:ffff880005bacf4a tail:0x48 end:0xc0 dev:lo
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:104!
invalid opcode: 0000 [#1] KASAN
CPU: 0 PID: 160 Comm: reproducer Not tainted 4.6.0-rc2 #65
[...]
Call Trace:
 [<ffffffff813eb7b9>] skb_push+0x79/0x80
 [<ffffffff8143397b>] eth_header+0x2b/0x100
 [<ffffffff8141e0d0>] neigh_resolve_output+0x210/0x310
 [<ffffffff814eab77>] ip6_finish_output2+0x4a7/0x7c0
 [<ffffffff814efe3a>] ip6_output+0x16a/0x280
 [<ffffffff815440c1>] ip6_local_out+0xb1/0xf0
 [<ffffffff814f1115>] ip6_send_skb+0x45/0xd0
 [<ffffffff81518836>] udp_v6_send_skb+0x246/0x5d0
 [<ffffffff8151985e>] udpv6_sendmsg+0xa6e/0x1090
[...]

Reported-by: Ji Jianwen <jiji@redhat.com>
Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-04-07 22:41:37 -04:00
..
ila
netfilter netfilter: x_tables: enforce nul-terminated table name from getsockopt GET_ENTRIES 2016-03-28 17:59:24 +02:00
Kconfig
Makefile
addrconf.c netconf: add macro to represent all attributes 2016-03-13 21:54:44 -04:00
addrconf_core.c
addrlabel.c
af_inet6.c
ah6.c
anycast.c
datagram.c
esp6.c
exthdrs.c
exthdrs_core.c ipv6: re-enable fragment header matching in ipv6_find_hdr 2016-03-03 16:35:20 -05:00
exthdrs_offload.c
fib6_rules.c
icmp.c
inet6_connection_sock.c
inet6_hashtables.c
ip6_checksum.c ipv6: Pass proto to csum_ipv6_magic as __u8 instead of unsigned short 2016-03-13 23:55:13 -04:00
ip6_fib.c ipv6: per netns FIB garbage collection 2016-03-08 15:16:51 -05:00
ip6_flowlabel.c
ip6_gre.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
ip6_icmp.c
ip6_input.c
ip6_offload.c tunnels: Don't apply GRO to multiple layers of encapsulation. 2016-03-20 16:33:40 -04:00
ip6_offload.h
ip6_output.c ipv6: Count in extension headers in skb->network_header 2016-04-07 22:41:37 -04:00
ip6_tunnel.c ip6_tunnel: set rtnl_link_ops before calling register_netdevice 2016-04-05 19:48:51 -04:00
ip6_udp_tunnel.c ip_tunnel: add support for setting flow label via collect metadata 2016-03-11 15:14:26 -05:00
ip6_vti.c
ip6mr.c
ipcomp6.c
ipv6_sockglue.c
mcast.c mld, igmp: Fix reserved tailroom calculation 2016-03-03 15:41:07 -05:00
mcast_snoop.c
mip6.c
ndisc.c
netfilter.c
output_core.c
ping.c net: ping: make ping_v6_sendmsg static 2016-03-23 22:09:58 -04:00
proc.c
protocol.c
raw.c
reassembly.c
route.c
sit.c tunnels: Remove encapsulation offloads on decap. 2016-03-20 16:33:40 -04:00
syncookies.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
sysctl_net_ipv6.c
tcp_ipv6.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
tcpv6_offload.c
tunnel6.c
udp.c ipv6: udp: fix UDP_MIB_IGNOREDMULTI updates 2016-03-30 19:01:33 -04:00
udp_impl.h
udp_offload.c
udplite.c
xfrm6_input.c
xfrm6_mode_beet.c
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c
xfrm6_output.c
xfrm6_policy.c
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c