]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 05:00:12 +0000 (21:00 -0800)
commit28256e48767def32bc3346faf229ed800ad422e2
tree4bc10a8db649f8db9f2c58432c45bee84c8923b0
parentef9bd1f4110fe3426a467d9bbfdc9ac6b25002b3
qed: Prevent stack corruption on MFW interaction

Orabug: 25477939

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
2edbff8dcb5d ("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: 2edbff8dcb5d ("qed: Learn resources from management firmware")
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bb48024284327768debd03a197d7c4179ec6ca05)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/qlogic/qed/qed_hsi.h
drivers/net/ethernet/qlogic/qed/qed_mcp.c