]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: bridge: delete local fdb on device init failure
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Mon, 29 Jul 2019 09:28:41 +0000 (12:28 +0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 17 Sep 2019 16:02:18 +0000 (18:02 +0200)
commita7b7ca79a031246e4ef3f2d7fe7d197fcfd3a29e
treec56220a29c7dd1c1720e24c42ee93e1fd614634e
parenta244dd0cb5b20a4ed74cad45d8f76d33eaa787cb
net: bridge: delete local fdb on device init failure

BugLink: https://bugs.launchpad.net/bugs/1840378
[ Upstream commit d7bae09fa008c6c9a489580db0a5a12063b97f97 ]

On initialization failure we have to delete the local fdb which was
inserted due to the default pvid creation. This problem has been present
since the inception of default_pvid. Note that currently there are 2 cases:
1) in br_dev_init() when br_multicast_init() fails
2) if register_netdevice() fails after calling ndo_init()

This patch takes care of both since br_vlan_flush() is called on both
occasions. Also the new fdb delete would be a no-op on normal bridge
device destruction since the local fdb would've been already flushed by
br_dev_delete(). This is not an issue for ports since nbp_vlan_init() is
called last when adding a port thus nothing can fail after it.

Reported-by: syzbot+88533dc8b582309bf3ee@syzkaller.appspotmail.com
Fixes: 5be5a2df40f0 ("bridge: Add filtering support for default_pvid")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
net/bridge/br_vlan.c