diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2015-01-23 12:01:26 +0100 |
---|---|---|
committer | Brett Rogers <brettrogers11@gmail.com> | 2016-02-22 16:35:36 -0800 |
commit | 13696bfd759e22d99eab7a81b18341b05772aad4 (patch) | |
tree | f4ef748cdf60bfc40761a1a66c19fd3b04ea77ab /net/ipv4/tcp_cubic.c | |
parent | 5080905535c3c977a96a0ef7faaa5095dafd7760 (diff) | |
download | kernel_samsung_smdk4412-13696bfd759e22d99eab7a81b18341b05772aad4.zip kernel_samsung_smdk4412-13696bfd759e22d99eab7a81b18341b05772aad4.tar.gz kernel_samsung_smdk4412-13696bfd759e22d99eab7a81b18341b05772aad4.tar.bz2 |
ipv4: try to cache dst_entries which would cause a redirect
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.
Cc: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Marcelo Leitner <mleitner@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
Conflicts:
include/net/ip.h
net/ipv4/route.c
Change-Id: I53e4b500a4db2f5fece937a42a3bd810b2640c44
Diffstat (limited to 'net/ipv4/tcp_cubic.c')
0 files changed, 0 insertions, 0 deletions