Skip to content

Commit

Permalink
bridge: fix crash when set mac address of br interface
Browse files Browse the repository at this point in the history
When I tried to set mac address of a bridge interface to a mac
address which already learned on this bridge, I got system hang.

The cause is straight forward: function br_fdb_change_mac_address
calls fdb_insert with NULL source nbp. Then an fdb lookup is
performed. If an fdb entry is found and it's local, it's OK. But
if it's not local, source is dereferenced for printk without NULL
check.

Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hong zhi guo authored and David S. Miller committed Mar 24, 2013
1 parent 4a7df34 commit 9b46922
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bridge/br_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
return 0;
br_warn(br, "adding interface %s with same address "
"as a received packet\n",
source->dev->name);
source ? source->dev->name : br->dev->name);
fdb_delete(br, fdb);
}

Expand Down

0 comments on commit 9b46922

Please sign in to comment.