net: avoid reference counter overflows on fib_rules in multicast forwarding
authorHannes Frederic Sowa <[email protected]>
Mon, 13 Jan 2014 01:45:22 +0000 (02:45 +0100)
committerDavid S. Miller <[email protected]>
Wed, 15 Jan 2014 01:37:25 +0000 (17:37 -0800)
commit95f4a45de1a0f172b35451fc52283290adb21f6e
tree04574bc5a4f4b60133b3dbc72c5174a9f847b3b4
parent7c4b5175f65f31e0cd9867a6ddc3171007dfc110
net: avoid reference counter overflows on fib_rules in multicast forwarding

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.

Fixes: f0ad0860d01e47 ("ipv4: ipmr: support multiple tables")
Fixes: d1db275dd3f6e4 ("ipv6: ip6mr: support multiple tables")
Reported-by: Bob Falken <[email protected]>
Cc: Patrick McHardy <[email protected]>
Cc: Thomas Graf <[email protected]>
Cc: Julian Anastasov <[email protected]>
Cc: Eric Dumazet <[email protected]>
Signed-off-by: Hannes Frederic Sowa <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/ipv4/ipmr.c
net/ipv6/ip6mr.c