Martin KaFai Lau 903ce4abdf ipv6: Fix mem leak in rt6i_pcpu
It was first reported and reproduced by Petr (thanks!) in
https://bugzilla.kernel.org/show_bug.cgi?id=119581

free_percpu(rt->rt6i_pcpu) used to always happen in ip6_dst_destroy().

However, after fixing a deadlock bug in
commit 9c7370a166b4 ("ipv6: Fix a potential deadlock when creating pcpu rt"),
free_percpu() is not called before setting non_pcpu_rt->rt6i_pcpu to NULL.

It is worth to note that rt6i_pcpu is protected by table->tb6_lock.

kmemleak somehow did not report it.  We nailed it down by
observing the pcpu entries in /proc/vmallocinfo (first suggested
by Hannes, thanks!).

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Fixes: 9c7370a166b4 ("ipv6: Fix a potential deadlock when creating pcpu rt")
Reported-by: Petr Novopashenniy <pety@rusnet.ru>
Tested-by: Petr Novopashenniy <pety@rusnet.ru>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Petr Novopashenniy <pety@rusnet.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-07-05 14:09:23 -07:00
..
2016-04-13 10:41:10 +02:00
2016-05-27 15:26:11 -07:00
2015-03-02 16:43:41 -05:00
2016-05-23 13:51:10 -07:00
2016-07-05 14:08:47 -07:00
2016-05-11 19:36:28 -04:00
2016-07-05 14:09:23 -07:00
2016-06-22 16:32:23 -04:00
2015-10-23 03:05:19 -07:00
2016-05-29 22:33:25 -07:00
2016-07-04 16:09:49 -07:00
2016-06-07 15:30:21 -07:00
2016-06-10 23:22:55 -07:00
2016-06-09 23:41:03 -07:00
2016-05-08 23:46:14 -04:00