From: David S. Miller Date: Fri, 11 May 2012 02:16:32 +0000 (-0400) Subject: ipv4: Do not use dead fib_info entries. X-Git-Tag: upstream/snapshot3+hdmi~7528^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dccd9ecc374462e5d6a5b8f8110415a86c2213d8;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ipv4: Do not use dead fib_info entries. Due to RCU lookups and RCU based release, fib_info objects can be found during lookup which have fi->fib_dead set. We must ignore these entries, otherwise we risk dereferencing the parts of the entry which are being torn down. Reported-by: Yevgen Pronenko Signed-off-by: David S. Miller --- diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index bce36f1..30b88d7 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -1370,6 +1370,8 @@ static int check_leaf(struct fib_table *tb, struct trie *t, struct leaf *l, if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) continue; + if (fi->fib_dead) + continue; if (fa->fa_info->fib_scope < flp->flowi4_scope) continue; fib_alias_accessed(fa);