bnxt_en: Check the lengths of encapsulated firmware responses.
authorMichael Chan <michael.chan@broadcom.com>
Thu, 26 Apr 2018 21:44:33 +0000 (17:44 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Apr 2018 18:47:28 +0000 (14:47 -0400)
commit59895f596b13b4b09f739bf8470a5028a5ff2b9a
tree8ebea69633dfb26bd9c34adacae41a819ec43036
parentd31cd579a45c44ede9e56c2f6d33537ba395a49b
bnxt_en: Check the lengths of encapsulated firmware responses.

Firmware messages that are forwarded from PF to VFs are encapsulated.
The size of these encapsulated messages must not exceed the maximum
defined message size.  Add appropriate checks to avoid oversize
messages.  Firmware messages may be expanded in future specs and
this will provide some guardrails to avoid data corruption.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h