diff options
| author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2016-07-11 15:18:17 -0700 |
|---|---|---|
| committer | Ariel Yin <ayin@google.com> | 2016-07-18 21:23:52 +0000 |
| commit | a59e0e672f95164a1661262295b39270834d4391 (patch) | |
| tree | 7c757e90152030af16549a220684c75bbb33f93e /net/unix/af_unix.c | |
| parent | 0b0aa99b69760797394fce2c4e2df5523c3500e4 (diff) | |
UPSTREAM: ipv4: try to cache dst_entries which would cause a redirect
(cherry pick from commit df4d92549f23e1c037e83323aff58a21b3de7fe0)
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>
Change-Id: I2928da29b79a94b60023a1c19e464eece0f1dc7a
Bug: 29506807
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
