This is a note to let you know that I've just added the patch titled ch_ktls: fix device connection close to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ch_ktls-fix-device-connection-close.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From bc16efd2430652f894ae34b1de5eccc3bf0d2810 Mon Sep 17 00:00:00 2001 From: Vinay Kumar Yadav <vinay.yadav@xxxxxxxxxxx> Date: Thu, 15 Apr 2021 13:17:46 +0530 Subject: ch_ktls: fix device connection close From: Vinay Kumar Yadav <vinay.yadav@xxxxxxxxxxx> commit bc16efd2430652f894ae34b1de5eccc3bf0d2810 upstream. When sge queue is full and chcr_ktls_xmit_wr_complete() returns failure, skb is not freed if it is not the last tls record in this skb, causes refcount never gets freed and tls_dev_del() never gets called on this connection. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Vinay Kumar Yadav <vinay.yadav@xxxxxxxxxxx> Signed-off-by: Rohit Maheshwari <rohitm@xxxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -1740,7 +1740,9 @@ static int chcr_end_part_handler(struct struct sge_eth_txq *q, u32 skb_offset, u32 tls_end_offset, bool last_wr) { + bool free_skb_if_tx_fails = false; struct sk_buff *nskb = NULL; + /* check if it is a complete record */ if (tls_end_offset == record->len) { nskb = skb; @@ -1763,6 +1765,8 @@ static int chcr_end_part_handler(struct if (last_wr) dev_kfree_skb_any(skb); + else + free_skb_if_tx_fails = true; last_wr = true; @@ -1774,6 +1778,8 @@ static int chcr_end_part_handler(struct record->num_frags, (last_wr && tcp_push_no_fin), mss)) { + if (free_skb_if_tx_fails) + dev_kfree_skb_any(skb); goto out; } tx_info->prev_seq = record->end_seq; Patches currently in stable-queue which might be from vinay.yadav@xxxxxxxxxxx are queue-5.10/ch_ktls-do-not-send-snd_una-update-to-tcb-in-middle.patch queue-5.10/ch_ktls-fix-device-connection-close.patch queue-5.10/ch_ktls-tcb-close-causes-tls-connection-failure.patch queue-5.10/ch_ktls-fix-kernel-panic.patch