Commit 1158f762e57c1cdcda631c1c5f339e4853caa82b

Authored by Pavel Emelyanov
Committed by David S. Miller
1 parent f60ac8e7ab

bridge: Don't put partly initialized fdb into hash

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 <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -328,12 +328,12 @@
328 328 fdb = kmem_cache_alloc(br_fdb_cache, GFP_ATOMIC);
329 329 if (fdb) {
330 330 memcpy(fdb->addr.addr, addr, ETH_ALEN);
331   - hlist_add_head_rcu(&fdb->hlist, head);
332   -
333 331 fdb->dst = source;
334 332 fdb->is_local = is_local;
335 333 fdb->is_static = is_local;
336 334 fdb->ageing_timer = jiffies;
  335 +
  336 + hlist_add_head_rcu(&fdb->hlist, head);
337 337 }
338 338 return fdb;
339 339 }