提交 2efd32ee 编写于 作者: E Eric Dumazet 提交者: David S. Miller

veth: fix a NULL deref in netif_carrier_off

In commit d0e2c55e (veth: avoid a NULL deref in veth_stats_one)
we now clear the peer pointers in veth_dellink()

veth_close() must therefore make sure the peer pointer is set.
Reported-by: NTom Parkin <tom.parkin@gmail.com>
Signed-off-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1f1e4958
......@@ -206,9 +206,11 @@ static int veth_open(struct net_device *dev)
static int veth_close(struct net_device *dev)
{
struct veth_priv *priv = netdev_priv(dev);
struct net_device *peer = rtnl_dereference(priv->peer);
netif_carrier_off(dev);
netif_carrier_off(rtnl_dereference(priv->peer));
if (peer)
netif_carrier_off(peer);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册