提交 1020ce31 编写于 作者: N Nikolay Aleksandrov 提交者: David S. Miller

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: NGustavo A. R. Silva <garsilva@embeddedor.com>
Fixes: efa5356b ("bridge: per vlan dst_metadata netlink support")
Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Acked-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 79514ef6
...@@ -595,7 +595,7 @@ static int br_afspec(struct net_bridge *br, ...@@ -595,7 +595,7 @@ static int br_afspec(struct net_bridge *br,
err = 0; err = 0;
switch (nla_type(attr)) { switch (nla_type(attr)) {
case IFLA_BRIDGE_VLAN_TUNNEL_INFO: case IFLA_BRIDGE_VLAN_TUNNEL_INFO:
if (!(p->flags & BR_VLAN_TUNNEL)) if (!p || !(p->flags & BR_VLAN_TUNNEL))
return -EINVAL; return -EINVAL;
err = br_parse_vlan_tunnel_info(attr, &tinfo_curr); err = br_parse_vlan_tunnel_info(attr, &tinfo_curr);
if (err) if (err)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册