提交 69d7126b 编写于 作者: H Hadar Hen Zion 提交者: David S. Miller

net/mlx4_en: Validate VLAN IDs provided in ethtool flow steering rules

When attaching flow steering rules via Ethtool accept only valid vlans IDs e.g
in the range: [0,4095].
Signed-off-by: NHadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: NAmir Vadai <amirv@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f90a3673
...@@ -669,6 +669,10 @@ static int mlx4_en_validate_flow(struct net_device *dev, ...@@ -669,6 +669,10 @@ static int mlx4_en_validate_flow(struct net_device *dev,
!(cmd->fs.m_ext.vlan_tci == 0 || !(cmd->fs.m_ext.vlan_tci == 0 ||
cmd->fs.m_ext.vlan_tci == cpu_to_be16(0xfff))) cmd->fs.m_ext.vlan_tci == cpu_to_be16(0xfff)))
return -EINVAL; return -EINVAL;
if (cmd->fs.m_ext.vlan_tci) {
if (be16_to_cpu(cmd->fs.h_ext.vlan_tci) >= VLAN_N_VID)
return -EINVAL;
}
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册