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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Aug 2016 23:09:55 +0000 (16:09 -0700)
commit2c0f8ce1b584a4d7b8ff53140d21dfed99834940
tree282b5df22c6f772b99a75edd074b6c18ec12d222
parent1061c90f524963a0a90e7d2f9a6bfa666458af51
net/mlx5: Added missing check of msg length in verifying its signature

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>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c