crypto/virtio: check for invalid IOVA address
Subsystems (3)
PATCH 1/1 crypto/virtio: check for invalid IOVA address
This change fixes coverity issue on overflowed constant. Bad phys address should be checked before using it in descriptor.
Coverity issue: 457462, 457465
Fixes 10702138f1a ("crypto/virtio: support asymmetric RSA")
Signed-off-by Gowrishankar Muthukrishnan <[email protected]>
--- drivers/crypto/virtio/virtio_cryptodev.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/crypto/virtio/virtio_cryptodev.c +8 -0
@@ -799,6 +799,10 @@ virtio_crypto_clear_session( } malloc_phys_addr =rte_malloc_virt2iova (ctrl); +if (malloc_phys_addr ==RTE_BAD_IOVA ) { +VIRTIO_CRYPTO_SESSION_LOG_ERR ("malloc_phys_addr is invalid" ); +return ; + }/* status part */ status = &(((struct virtio_crypto_inhdr *)
@@ -916,6 +920,10 @@ virtio_crypto_clear_session_packed( } malloc_phys_addr =rte_malloc_virt2iova (ctrl); +if (malloc_phys_addr ==RTE_BAD_IOVA ) { +VIRTIO_CRYPTO_SESSION_LOG_ERR ("malloc_phys_addr is invalid" ); +return ; + }/* status part */ status = &(((struct virtio_crypto_inhdr *)
Signature · 1 line
2.25.1
Quoted 8 lines
This change fixes coverity issue on overflowed constant. Bad phys address should be checked before using it in descriptor.
Coverity issue: 457462, 457465
Fixes 10702138f1a ("crypto/virtio: support asymmetric RSA")Signed-off-by Gowrishankar Muthukrishnan <[email protected]>
Acked-by Akhil Goyal <[email protected]>
Applied to dpdk-next-crypto
Thanks