[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.11.1501211041360.2329@ja.home.ssi.bg>
Date: Wed, 21 Jan 2015 10:56:16 +0200 (EET)
From: Julian Anastasov <ja@....bg>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
cc: netdev@...r.kernel.org, Marcelo Leitner <mleitner@...hat.com>,
Florian Westphal <fw@...len.de>
Subject: Re: [PATCH net] ipv4: try to cache dst_entries which would cause a
redirect
Hello,
On Tue, 20 Jan 2015, Hannes Frederic Sowa wrote:
> Not caching dst_entries which cause redirects could be exploited by hosts
> on the same subnet, causing a severe DoS attack. This effect aggravated
> since commit f88649721268999 ("ipv4: fix dst race in sk_dst_get()").
>
> Lookups causing redirects will be allocated with DST_NOCACHE set which
> will force dst_release to free them via RCU. Unfortunately waiting for
> RCU grace period just takes too long, we can end up with >1M dst_entries
> waiting to be released and the system will run OOM. rcuos threads cannot
> catch up under high softirq load.
>
> Attaching the flag to emit a redirect later on to the specific skb allows
> us to cache those dst_entries thus reducing the pressure on allocation
> and deallocation.
>
> This issue was discovered by Marcelo Leitner.
Change looks good to me but additional place
should be changed too: inet_rtm_getroute() will call
ip_route_input() and later rt_fill_info() will put
rt_flags in rtm_flags. We have to set RTCF_DOREDIRECT
just in rtm_flags depending on IPSKB_DOREDIRECT becuase
iproute needs to print "redirect". You can test it with
ip route get ... iif INDEV
Regards
--
Julian Anastasov <ja@....bg>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists