crypto/octeontx: fix freeing after device release
authorAkhil Goyal <gakhil@marvell.com>
Fri, 30 Jul 2021 17:58:27 +0000 (23:28 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Fri, 30 Jul 2021 19:08:19 +0000 (21:08 +0200)
commit12b650efd49d8b932a7717be1cafd13d9040ea3e
tree531473947d4c86a566479b06db34501b9f2e394e
parenteeaeca82b8cbd6599bafd4029aad5ce4dedff7a2
crypto/octeontx: fix freeing after device release

When the PMD is removed, rte_cryptodev_pmd_release_device
is called which frees cryptodev->data, and then tries to free
cryptodev->data->dev_private, which causes the heap use
after free issue.

A temporary pointer is set before the free of cryptodev->data,
which can then be used afterwards to free dev_private.

Fixes: bfe2ae495ee2 ("crypto/octeontx: add PMD skeleton")
Cc: stable@dpdk.org
Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
drivers/crypto/octeontx/otx_cryptodev.c