hannes@stressinduktion.org f60e5990d9 ipv6: protect skb->sk accesses from recursive dereference inside the stack
We should not consult skb->sk for output decisions in xmit recursion
levels > 0 in the stack. Otherwise local socket settings could influence
the result of e.g. tunnel encapsulation process.

ipv6 does not conform with this in three places:

1) ip6_fragment: we do consult ipv6_npinfo for frag_size

2) sk_mc_loop in ipv6 uses skb->sk and checks if we should
   loop the packet back to the local socket

3) ip6_skb_dst_mtu could query the settings from the user socket and
   force a wrong MTU

Furthermore:
In sk_mc_loop we could potentially land in WARN_ON(1) if we use a
PF_PACKET socket ontop of an IPv6-backed vxlan device.

Reuse xmit_recursion as we are currently only interested in protecting
tunnel devices.

Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-06 16:12:49 -04:00
..
2014-09-18 10:54:36 +02:00
2013-12-28 17:02:46 -05:00
2013-11-07 19:28:58 -05:00
2014-09-30 01:02:26 -04:00
2014-06-04 22:46:38 -07:00
2015-01-18 01:56:32 -05:00
2008-06-11 21:00:38 -07:00
2014-01-03 20:56:48 -05:00
2014-12-19 00:19:23 +01:00
2015-01-15 18:26:16 -05:00
2014-06-02 11:00:41 -07:00
2015-02-09 18:45:00 -08:00
2014-05-22 14:57:15 -04:00
2014-10-01 21:35:51 -04:00