Please sign in to comment.
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 <firstname.lastname@example.org> Signed-off-by: Marcelo Leitner <email@example.com> Signed-off-by: Florian Westphal <firstname.lastname@example.org> Signed-off-by: Hannes Frederic Sowa <email@example.com> Signed-off-by: Julian Anastasov <firstname.lastname@example.org> Signed-off-by: David S. Miller <email@example.com> Conflicts: include/net/ip.h net/ipv4/route.c Change-Id: I53e4b500a4db2f5fece937a42a3bd810b2640c44
- Loading branch information...
Showing with 12 additions and 7 deletions.