qede: validate non LSO skb length
Subsystems (3)
PATCH 1/1 qede: validate non LSO skb length
Although it is unlikely that stack could transmit a non LSO skb with length > MTU, however in some cases or environment such occurrences actually resulted into firmware asserts due to packet length being greater than the max supported by the device (~9700B).
This patch adds the safeguard for such odd cases to avoid firmware asserts.
--- drivers/net/ethernet/qlogic/qede/qede_fp.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/qlogic/qede/qede_fp.c +7 -0
@@ -1644,6 +1644,13 @@ netdev_tx_t qede_start_xmit(struct sk_buff *skb, struct net_device *ndev) data_split = true; } }else { +if (unlikely (skb->len >ETH_TX_MAX_NON_LSO_PKT_LEN )) { +DP_ERR (edev,"Unexpected non LSO skb length = 0x%x\n" , skb->len); +qede_free_failed_tx_pkt (txq, first_bd,0 , false); +qede_update_tx_producer (txq); +return NETDEV_TX_OK ; + } + val |= ((skb->len Ð_TX_DATA_1ST_BD_PKT_LEN_MASK ) <<ETH_TX_DATA_1ST_BD_PKT_LEN_SHIFT ); }
Signature · 1 line
2.27.0
Jakub Kicinski
maintainerQuoted 5 lines · On Wed, 24 Nov 2021 01:24:05 -0800 Manish Chopra wrote:
Although it is unlikely that stack could transmit a non LSO skb with length > MTU, however in some cases or environment such occurrences actually resulted into firmware asserts due to packet length being greater than the max supported by the device (~9700B).
Quoted 7 lines
This patch adds the safeguard for such odd cases to avoid firmware asserts.
Signed-off-by Manish Chopra <[email protected]>Signed-off-by Alok Prasad <[email protected]>Signed-off-by Prabhakar Kushwaha <[email protected]>Signed-off-by Ariel Elior <[email protected]>
Please add an appropriate Fixes tag and repost.
Quoted 20 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Thursday, November 25, 2021 5:08 AM
To: Manish Chopra <[email protected]>
Cc: [email protected]; Ariel Elior <[email protected]>; Alok Prasad <[email protected]>; Prabhakar Kushwaha <[email protected]>
Subject: [EXT] Re: [PATCH net] qede: validate non LSO skb lengthExternal Email
----------------------------------------------------------------------
Quoted 8 lines · On Wed, 24 Nov 2021 01:24:05 -0800 Manish Chopra wrote:
Although it is unlikely that stack could transmit a non LSO skb with length > MTU, however in some cases or environment such occurrences actually resulted into firmware asserts due to packet length being greater than the max supported by the device (~9700B).
This patch adds the safeguard for such odd cases to avoid firmware asserts.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Manish Chopra <[email protected]>Signed-off-by Alok Prasad <[email protected]>Signed-off-by Prabhakar Kushwaha <[email protected]>Signed-off-by Ariel Elior <[email protected]>Please add an appropriate Fixes tag and repost.
Hello Jakub,
I don't really know which commit has introduced this exactly. It was probably day1 (when this driver was submitted) behavior, just that this issue was discovered recently by some customer environment.
Let me know if you want me to put one of those initial driver commit tag here and repost ?
Thanks,
Manish
Jakub Kicinski
maintainerQuoted 16 lines · On Thu, 2 Dec 2021 21:19:26 +0000 Manish Chopra wrote:
Quoted 9 lines · On Wed, 24 Nov 2021 01:24:05 -0800 Manish Chopra wrote:
Quoted 8 lines
Although it is unlikely that stack could transmit a non LSO skb with length > MTU, however in some cases or environment such occurrences actually resulted into firmware asserts due to packet length being greater than the max supported by the device (~9700B).
This patch adds the safeguard for such odd cases to avoid firmware asserts.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Manish Chopra <[email protected]>Signed-off-by Alok Prasad <[email protected]>Signed-off-by Prabhakar Kushwaha <[email protected]>Signed-off-by Ariel Elior <[email protected]>Please add an appropriate Fixes tag and repost.
Quoted 7 lines
Hello Jakub,
I don't really know which commit has introduced this exactly. It was probably day1 (when this driver was submitted) behavior, just that this issue was discovered recently by some customer environment. Let me know if you want me to put one of those initial driver commit tag here and repost ?
Yes, that'd be best. This way any sort of automation for tracking which fixes need to be backported will have clear signal that this fix applies to all the kernels.