DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] crypto/virtio: fix out of bounds access bug
@ 2022-02-21 18:05 Brian Dooley
  2022-02-22  9:54 ` [PATCH v2] " Brian Dooley
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Dooley @ 2022-02-21 18:05 UTC (permalink / raw)
  To: dev; +Cc: Brian Dooley, roy.fan.zhang, Jay Zhou

Coverity flags an untrusted loop bound. Check length of session iv.

Coverity issue: 375802

Fixes: b063e843fa03 ("crypto/virtio: fix IV physical address")
Cc: roy.fan.zhang@intel.com

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/crypto/virtio/virtio_rxtx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c
index a65524a306..f3f2e75c00 100644
--- a/drivers/crypto/virtio/virtio_rxtx.c
+++ b/drivers/crypto/virtio/virtio_rxtx.c
@@ -264,6 +264,9 @@ virtqueue_crypto_sym_enqueue_xmit(
 		if (cop->phys_addr)
 			desc[idx].addr = cop->phys_addr + session->iv.offset;
 		else {
+			if (VIRTIO_CRYPTO_MAX_IV_SIZE < session->iv.length)
+				return -ENOMEM;
+
 			rte_memcpy(crypto_op_cookie->iv,
 					rte_crypto_op_ctod_offset(cop,
 					uint8_t *, session->iv.offset),
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-23 11:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 18:05 [PATCH] crypto/virtio: fix out of bounds access bug Brian Dooley
2022-02-22  9:54 ` [PATCH v2] " Brian Dooley
2022-02-23 10:58   ` Zhang, Roy Fan
2022-02-23 11:10   ` Zhang, Roy Fan
2022-02-23 11:12     ` Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).