Skip to content

Commit

Permalink
bridge: Don't put partly initialized fdb into hash
Browse files Browse the repository at this point in the history
The fdb_create() puts a new fdb into hash with only addr set. This is
not good, since there are callers, that search the hash w/o the lock
and access all the other its fields.

Applies to current netdev tree.

Signed-off-by: Pavel Emelyanov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
xemul authored and davem330 committed Feb 4, 2011
1 parent f60ac8e commit 1158f76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bridge/br_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ static struct net_bridge_fdb_entry *fdb_create(struct hlist_head *head,
fdb = kmem_cache_alloc(br_fdb_cache, GFP_ATOMIC);
if (fdb) {
memcpy(fdb->addr.addr, addr, ETH_ALEN);
hlist_add_head_rcu(&fdb->hlist, head);

fdb->dst = source;
fdb->is_local = is_local;
fdb->is_static = is_local;
fdb->ageing_timer = jiffies;

hlist_add_head_rcu(&fdb->hlist, head);
}
return fdb;
}
Expand Down

0 comments on commit 1158f76

Please sign in to comment.