]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
bnxt_en: Drop oversize TX packets to prevent errors.
authorMichael Chan <michael.chan@broadcom.com>
Wed, 27 Feb 2019 08:58:53 +0000 (03:58 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit8a1e1f66806ae5a410a3e44e5f57e259b015594c
tree1ca6ad688865752c4cf1333b3aeda0a0c4231482
parenta26d0b799ab0fd13b48f79dc9871e3b0b6b2b58e
bnxt_en: Drop oversize TX packets to prevent errors.

BugLink: https://bugs.launchpad.net/bugs/1837813
[ Upstream commit 2b3c6885386020b1b9d92d45e8349637e27d1f66 ]

There have been reports of oversize UDP packets being sent to the
driver to be transmitted, causing error conditions.  The issue is
likely caused by the dst of the SKB switching between 'lo' with
64K MTU and the hardware device with a smaller MTU.  Patches are
being proposed by Mahesh Bandewar <maheshb@google.com> to fix the
issue.

In the meantime, add a quick length check in the driver to prevent
the error.  The driver uses the TX packet size as index to look up an
array to setup the TX BD.  The array is large enough to support all MTU
sizes supported by the driver.  The oversize TX packet causes the
driver to index beyond the array and put garbage values into the
TX BD.  Add a simple check to prevent this.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c