]> git.baikalelectronics.ru Git - kernel.git/commit
chelsio/chtls: fix a double free in chtls_setkey()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 3 Dec 2020 08:44:31 +0000 (11:44 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Dec 2020 18:53:35 +0000 (10:53 -0800)
commitc5f5e66bbd1c44543faec0c4887815239a455017
tree532e05f8902c8e045733fb33d8fd7e6ed61f1dbd
parenta4d077cd458d3a1103696f841436b2ef1114e3ba
chelsio/chtls: fix a double free in chtls_setkey()

The "skb" is freed by the transmit code in cxgb4_ofld_send() and we
shouldn't use it again.  But in the current code, if we hit an error
later on in the function then the clean up code will call kfree_skb(skb)
and so it causes a double free.

Set the "skb" to NULL and that makes the kfree_skb() a no-op.

Fixes: 819d3b8d1abf ("crypto: chtls - Program the TLS session Key")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X8ilb6PtBRLWiSHp@mwanda
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c