]> git.baikalelectronics.ru Git - kernel.git/commit
bridge: vlan: fix possible null vlgrp deref while registering new port
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Wed, 30 Sep 2015 18:16:52 +0000 (20:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Oct 2015 01:24:04 +0000 (18:24 -0700)
commit5e0572870fcb05b1be3897c67fe718baa18beeb6
tree473b882e2365c413e85cef4adfef8ee41a4a819f
parentdd1224fc542550922a3e4ac99fd7c98868ca7a6b
bridge: vlan: fix possible null vlgrp deref while registering new port

While a new port is being initialized the rx_handler gets set, but the
vlans get initialized later in br_add_if() and in that window if we
receive a frame with a link-local address we can try to dereference
p->vlgrp in:
br_handle_frame() -> br_handle_local_finish() -> br_should_learn()

Fix this by checking vlgrp before using it.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_vlan.c