aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2014-01-09 04:01:15 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-13 14:22:54 -0500
commitf87c10a8aa1e82498c42d0335524d6ae7cf5a52b (patch)
tree85117fae4f0f25831d4232155b47f3f6553faf27 /Documentation/networking
parent6c76a07a711165a31332aa619215f961b115071d (diff)
ipv4: introduce ip_dst_mtu_maybe_forward and protect forwarding path against pmtu spoofing
While forwarding we should not use the protocol path mtu to calculate the mtu for a forwarded packet but instead use the interface mtu. We mark forwarded skbs in ip_forward with IPSKB_FORWARDED, which was introduced for multicast forwarding. But as it does not conflict with our usage in unicast code path it is perfect for reuse. I moved the functions ip_sk_accept_pmtu, ip_sk_use_pmtu and ip_skb_dst_mtu along with the new ip_dst_mtu_maybe_forward to net/ip.h to fix circular dependencies because of IPSKB_FORWARDED. Because someone might have written a software which does probe destinations manually and expects the kernel to honour those path mtus I introduced a new per-namespace "ip_forward_use_pmtu" knob so someone can disable this new behaviour. We also still use mtus which are locked on a route for forwarding. The reason for this change is, that path mtus information can be injected into the kernel via e.g. icmp_err protocol handler without verification of local sockets. As such, this could cause the IPv4 forwarding path to wrongfully emit fragmentation needed notifications or start to fragment packets along a path. Tunnel and ipsec output paths clear IPCB again, thus IPSKB_FORWARDED won't be set and further fragmentation logic will use the path mtu to determine the fragmentation size. They also recheck packet size with help of path mtu discovery and report appropriate errors. Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: David Miller <davem@davemloft.net> Cc: John Heffner <johnwheffner@gmail.com> Cc: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking')
-rw-r--r--Documentation/networking/ip-sysctl.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 7373115407e4..0d71fa962d8a 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -32,6 +32,19 @@ ip_no_pmtu_disc - INTEGER
32min_pmtu - INTEGER 32min_pmtu - INTEGER
33 default 552 - minimum discovered Path MTU 33 default 552 - minimum discovered Path MTU
34 34
35ip_forward_use_pmtu - BOOLEAN
36 By default we don't trust protocol path MTUs while forwarding
37 because they could be easily forged and can lead to unwanted
38 fragmentation by the router.
39 You only need to enable this if you have user-space software
40 which tries to discover path mtus by itself and depends on the
41 kernel honoring this information. This is normally not the
42 case.
43 Default: 0 (disabled)
44 Possible values:
45 0 - disabled
46 1 - enabled
47
35route/max_size - INTEGER 48route/max_size - INTEGER
36 Maximum number of routes allowed in the kernel. Increase 49 Maximum number of routes allowed in the kernel. Increase
37 this when using large numbers of interfaces and/or routes. 50 this when using large numbers of interfaces and/or routes.