diff options
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/fw.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 13b2e4a51ef4..2e88a235e26b 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -982,8 +982,13 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, | |||
982 | if (port < 0) | 982 | if (port < 0) |
983 | return -EINVAL; | 983 | return -EINVAL; |
984 | 984 | ||
985 | vhcr->in_modifier = (vhcr->in_modifier & ~0xFF) | | 985 | /* Protect against untrusted guests: enforce that this is the |
986 | (port & 0xFF); | 986 | * QUERY_PORT general query. |
987 | */ | ||
988 | if (vhcr->op_modifier || vhcr->in_modifier & ~0xFF) | ||
989 | return -EINVAL; | ||
990 | |||
991 | vhcr->in_modifier = port; | ||
987 | 992 | ||
988 | err = mlx4_cmd_box(dev, 0, outbox->dma, vhcr->in_modifier, 0, | 993 | err = mlx4_cmd_box(dev, 0, outbox->dma, vhcr->in_modifier, 0, |
989 | MLX4_CMD_QUERY_PORT, MLX4_CMD_TIME_CLASS_B, | 994 | MLX4_CMD_QUERY_PORT, MLX4_CMD_TIME_CLASS_B, |