[Devel] [PATCH rh7] net: avoid reference counter overflows on fib_rules in multicast forwarding

Stanislav Kinsburskiy skinsbursky at odin.com
Tue Nov 24 02:21:55 PST 2015



24.11.2015 09:34, Andrey Ryabinin пишет:
>
> On 11/23/2015 07:08 PM, Stanislav Kinsburskiy wrote:
>> From: Hannes Frederic Sowa <hannes at stressinduktion.org>
>>
>> Bob Falken reported that after 4G packets, multicast forwarding stopped
>> working. This was because of a rule reference counter overflow which
>> freed the rule as soon as the overflow happend.
>>
>> This patch solves this by adding the FIB_LOOKUP_NOREF flag to
>> fib_rules_lookup calls. This is safe even from non-rcu locked sections
>> as in this case the flag only implies not taking a reference to the rule,
>> which we don't need at all.
>>
>> Rules only hold references to the namespace, which are guaranteed to be
>> available during the call of the non-rcu protected function reg_vif_xmit
>> because of the interface reference which itself holds a reference to
>> the net namespace.
>>
>> Backport: https://jira.sw.ru/browse/PSBM-41453
>>
>> Fixes: f0ad0860d01e47 ("ipv4: ipmr: support multiple tables")
>> Fixes: d1db275dd3f6e4 ("ipv6: ip6mr: support multiple tables")
>> Reported-by: Bob Falken <NetFestivalHaveFun at gmx.com>
>> Cc: Patrick McHardy <kaber at trash.net>
>> Cc: Thomas Graf <tgraf at suug.ch>
>> Cc: Julian Anastasov <ja at ssi.bg>
>> Cc: Eric Dumazet <eric.dumazet at gmail.com>
>> Signed-off-by: Hannes Frederic Sowa <hannes at stressinduktion.org>
>> Acked-by: Eric Dumazet <edumazet at google.com>
>> Signed-off-by: David S. Miller <davem at davemloft.net>
>> Signed-off-by: Stanislav Kinsburskiy <skinsbursky at odin.com>
>> ---
>>   net/ipv4/ipmr.c  |    7 +++++--
>>   net/ipv6/ip6mr.c |    7 +++++--
>>   2 files changed, 10 insertions(+), 4 deletions(-)
>>
> What about dn_fib_lookup()? Do we need a similar patch  for it?
> Anyway, this patch LGTM:
> 	Reviewed-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
>

Nope. All the calls are paired with dn_fib_res_put(), which does 
fib_rule_put()



More information about the Devel mailing list