]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4: Fix memory corruption in mlx4_MAD_IFC_wrapper
authorMatan Barak <matanb@mellanox.com>
Tue, 27 Jan 2015 13:58:07 +0000 (15:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Jan 2015 01:12:58 +0000 (17:12 -0800)
commit80f700a7aa9d8bea59bce1d8c6f9710500151ff4
tree60523d1ada891d59bcdb25cd00a847dd7e62e7b8
parent1717b49c4fcf7e3ce70da2f7eb4ee912bf74aaa4
net/mlx4: Fix memory corruption in mlx4_MAD_IFC_wrapper

Fix a memory corruption at mlx4_MAD_IFC_wrapper.

A table of size dev->caps.pkey_table_len[port]*sizeof(*table)
was allocated, but get_full_pkey_table() assumes that the number
of entries in the table is a multiplication of 32 (which isn't always
correct).

Fixes: cff7c44 ('mlx4: MAD_IFC paravirtualization')
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/cmd.c