]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: bridge: fix a null pointer dereference in br_afspec
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Mon, 5 Jun 2017 22:26:24 +0000 (01:26 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Jun 2017 20:05:31 +0000 (16:05 -0400)
commit1020ce3108cc26fbf09d70550ea2937cb1a211d2
tree5933ffa09ce8626a546e1591a69b24199e3a7781
parent79514ef670e9e575a1fe36922268c439d0f0ca8a
net: bridge: fix a null pointer dereference in br_afspec

We might call br_afspec() with p == NULL which is a valid use case if
the action is on the bridge device itself, but the bridge tunnel code
dereferences the p pointer without checking, so check if p is null
first.

Reported-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Fixes: efa5356b0d97 ("bridge: per vlan dst_metadata netlink support")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_netlink.c