net/mlx5: Added missing check of msg length in verifying its signature
authorPaul Blakey <paulb@mellanox.com>
Thu, 18 Aug 2016 18:09:05 +0000 (21:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Sep 2016 08:18:36 +0000 (10:18 +0200)
commitc03c024fd36db587cb0797408d5c64adf096f678
tree0412b383ed3bbccc16b3d74afeabc5dae4d645c5
parent4be4511af7966b7b0f93d9f129a876458794f2f3
net/mlx5: Added missing check of msg length in verifying its signature

[ Upstream commit 2c0f8ce1b584a4d7b8ff53140d21dfed99834940 ]

Set and verify signature calculates the signature for each of the
mailbox nodes, even for those that are unused (from cache). Added
a missing length check to set and verify only those which are used.

While here, also moved the setting of msg's nodes token to where we
already go over them. This saves a pass because checksum is disabled,
and the only useful thing remaining that set signature does is setting
the token.

Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB
adapters')
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c