From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: netdev@vger.kernel.org, Fernando Gont <fgont@si6networks.com>
Subject: Re: [RFC PATCH net-next] ipv6: stop sending PTB packets for MTU < 1280
Date: Tue, 26 Aug 2014 00:47:22 +0200 [thread overview]
Message-ID: <1409006842.6274.69.camel@localhost> (raw)
In-Reply-To: <1409005545-24910-2-git-send-email-hagen@jauu.net>
Hi Hagen,
On Di, 2014-08-26 at 00:25 +0200, Hagen Paul Pfeifer wrote:
> Reduce the attack vector and stop generating ICMPv6 packet to big for
> packets smaller then the minimal required IPv6 MTU.
>
> See
> http://tools.ietf.org/html/draft-gont-6man-deprecate-atomfrag-generation-00
I wonder if we should wait until this gets RFC status?
I very much welcome this decision! I already raised this problem some
time ago:
http://lists.openwall.net/netdev/2013/12/31/17
I wonder if we should add a mode alike ipv4 ip_no_pmtu_disc mode for
ipv6:
ip_no_pmtu_disc - INTEGER
Disable Path MTU Discovery. If enabled in mode 1 and a
fragmentation-required ICMP is received, the PMTU to this
destination will be set to min_pmtu (see below). You will need
to raise min_pmtu to the smallest interface MTU on your system
manually if you want to avoid locally generated fragments.
In mode 2 incoming Path MTU Discovery messages will be
discarded. Outgoing frames are handled the same as in mode 1,
implicitly setting IP_PMTUDISC_DONT on every created socket.
Mode 3 is a hardend pmtu discover mode. The kernel will only
accept fragmentation-needed errors if the underlying protocol
can verify them besides a plain socket lookup. Current
protocols for which pmtu events will be honored are TCP, SCTP
and DCCP as they verify e.g. the sequence number or the
association. This mode should not be enabled globally but is
only intended to secure e.g. name servers in namespaces where
TCP path mtu must still work but path MTU information of other
protocols should be discarded. If enabled globally this mode
could break other protocols.
Possible values: 0-3
Default: FALSE
Not sure yet...
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
> ---
> net/ipv6/route.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index f74b041..84ebacd 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -1154,12 +1154,9 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
> struct net *net = dev_net(dst->dev);
>
> rt6->rt6i_flags |= RTF_MODIFIED;
> - if (mtu < IPV6_MIN_MTU) {
> - u32 features = dst_metric(dst, RTAX_FEATURES);
> + if (mtu < IPV6_MIN_MTU)
> mtu = IPV6_MIN_MTU;
> - features |= RTAX_FEATURE_ALLFRAG;
> - dst_metric_set(dst, RTAX_FEATURES, features);
> - }
> +
> dst_metric_set(dst, RTAX_MTU, mtu);
> rt6_update_expires(rt6, net->ipv6.sysctl.ip6_rt_mtu_expires);
> }
This patch is a starter, yes. We can now get rid of the dst_allfrag
function altogether.
Thanks,
Hannes
next prev parent reply other threads:[~2014-08-25 22:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <53F33C4F.2070807@si6networks.com>
2014-08-19 18:58 ` Deprecating the *generation* of IPv6 atomic fragments (Fwd: DoS attacks (ICMPv6-based) resulting from IPv6 EH drops) Fernando Gont
2014-08-25 22:25 ` [RFC PATCH net-next] ipv6: stop sending PTB packets for MTU < 1280 Hagen Paul Pfeifer
2014-08-25 22:47 ` Hannes Frederic Sowa [this message]
2014-08-26 8:06 ` Hagen Paul Pfeifer
2014-08-27 20:33 ` Fernando Gont
2014-08-27 20:57 ` Hagen Paul Pfeifer
2014-08-27 23:07 ` Hannes Frederic Sowa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409006842.6274.69.camel@localhost \
--to=hannes@stressinduktion.org \
--cc=fgont@si6networks.com \
--cc=hagen@jauu.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).