]> git.baikalelectronics.ru Git - kernel.git/commit
ionic: linearize tso skb with too many frags
authorShannon Nelson <snelson@pensando.io>
Wed, 17 Mar 2021 00:07:47 +0000 (17:07 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Mar 2021 18:27:30 +0000 (11:27 -0700)
commit4c9f71e64a89a43cd7b6139c76ec8d983448ae6d
treed6a8b6e0b5ef8d571b7c8003a627e42d957edbbb
parent59d850cc754eb2db453d2b3e103189fcdef21c62
ionic: linearize tso skb with too many frags

We were linearizing non-TSO skbs that had too many frags, but
we weren't checking number of frags on TSO skbs.  This could
lead to a bad page reference when we received a TSO skb with
more frags than the Tx descriptor could support.

v2: use gso_segs rather than yet another division
    don't rework the check on the nr_frags

Fixes: 2afc07987ed0 ("ionic: Add Tx and Rx handling")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_txrx.c