]> git.baikalelectronics.ru Git - kernel.git/commit
qed: Prevent stack corruption on MFW interaction
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Sun, 6 Nov 2016 15:12:27 +0000 (17:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Nov 2016 18:27:25 +0000 (13:27 -0500)
commitf67f921c66927aa317c44af80d6535d7196cf9de
tree0cb38c93e295418812234bb180fdac7fc951d910
parent3db5ed6323026216fe3a86e40bd9524f945ab181
qed: Prevent stack corruption on MFW interaction

Driver uses a union for copying data to & from management firmware
when interacting with it.
Problem is that the function always copies sizeof(union) while commit
a547d3856785 ("qed: Learn resources from management firmware") is casting
a union elements which is of smaller size [24-byte instead of 88-bytes].

Also, the union contains some inappropriate elements which increase its
size [should have been 32-bytes]. While this shouldn't corrupt other
PF messages to the MFW [as management firmware enforces permissions so
that each PF is allowed to write only to its own mailbox] we fix this
here as well.

Fixes: a547d3856785 ("qed: Learn resources from management firmware")
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_hsi.h
drivers/net/ethernet/qlogic/qed/qed_mcp.c