Skip to contentSkip to conversation

compress/isal: fixes offset check

PATCH Superseded Lee Daly 2 participants 5 messages Jul 31, 2018 – Aug 3, 2018

lore
Share & tools
lore

Lee Daly

author
#0 lore raw

PATCH 1/1 compress/isal: fixes offset check

This commit fixes an offset check in decompression which was checking destination offset size against dst data_len rather than checking against dst pkt_len as required.

Fixes 788e748d3845 ("compress/isal: support chained mbufs")
---
 drivers/compress/isal/isal_compress_pmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/compress/isal/isal_compress_pmd.c +1 -1
index e75f48d..aef56e3 100644
@@ -483,7 +483,7 @@ process_isal_inflate(struct rte_comp_op *op, struct isal_comp_qp *qp)
 		return -1;
 	}
 
-	if (op->dst.offset > op->m_dst->data_len) {
+	if (op->dst.offset > op->m_dst->pkt_len) {
 		ISAL_PMD_LOG(ERR, "Output mbuf not big enough for length and "
 				"offset provided.\n");
 		op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
Signature · 1 line
2.7.4
#1 lore raw

Hi Lee,

Quoted 24 lines

-----Original Message-----
From: Daly, Lee
Sent: Tuesday, July 31, 2018 12:09 PM
To: De Lara Guarch, Pablo <[email protected]>
Cc: [email protected]; Daly, Lee <[email protected]>
Subject: [PATCH] compress/isal: fixes offset check

This commit fixes an offset check in decompression which was checking destination offset size against dst data_len rather than checking against dst pkt_len as required.

Fixes 788e748d3845 ("compress/isal: support chained mbufs")
---
 drivers/compress/isal/isal_compress_pmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/compress/isal/isal_compress_pmd.c +0 -0
index e75f48d..aef56e3 100644

drivers/compress/isal/isal_compress_pmd.c process_isal_inflate(struct rte_comp_op *op, struct · line 487

Quoted 6 lines
drivers/compress/isal/isal_compress_pmd.c +1 -1
@@ -483,7 +483,7 @@ process_isal_inflate(struct rte_comp_op *op, struct
 isal_comp_qp *qp)
 		return -1;
 	}
 
-	if (op->dst.offset > op->m_dst->data_len) {
+	if (op->dst.offset > op->m_dst->pkt_len) {

Actually, I think you should check if offset is higher or EQUAL to pktlen (>=). This applies to the isal_deflate function too.

Quoted 3 lines
drivers/compress/isal/isal_compress_pmd.c +0 -0
 		ISAL_PMD_LOG(ERR, "Output mbuf not big enough for length

and "
"offset provided.\n");

I think message should say that mbuf is not big enough for the offset provided, as length is not passed like in the input mbufs.

Quoted 3 lines

op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
--
2.7.4

Thanks,
Pablo

author
#2 lore raw

PATCH v2 1/1 compress/isal: fixes offset check

In reply to Lee Daly

This commit fixes an offset check in decompression which was checking destination offset size against dst data_len rather than checking against dst pkt_len as required.

Fixes 788e748d3845 ("compress/isal: support chained mbufs")
---
 drivers/compress/isal/isal_compress_pmd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/compress/isal/isal_compress_pmd.c +5 -5
index e75f48d..e943336 100644
@@ -404,9 +404,9 @@ process_isal_deflate(struct rte_comp_op *op, struct isal_comp_qp *qp,
 		return -1;
 	}
 
-	if (op->dst.offset > op->m_dst->pkt_len) {
-		ISAL_PMD_LOG(ERR, "Output mbuf(s) not big enough for length"
-				" and offset provided.\n");
+	if (op->dst.offset >= op->m_dst->pkt_len) {
+		ISAL_PMD_LOG(ERR, "Output mbuf(s) not big enough"
+				" for offset provided.\n");
 		op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
 		return -1;
 	}
@@ -483,8 +483,8 @@ process_isal_inflate(struct rte_comp_op *op, struct isal_comp_qp *qp)
 		return -1;
 	}
 
-	if (op->dst.offset > op->m_dst->data_len) {
-		ISAL_PMD_LOG(ERR, "Output mbuf not big enough for length and "
+	if (op->dst.offset >= op->m_dst->pkt_len) {
+		ISAL_PMD_LOG(ERR, "Output mbuf not big enough for "
 				"offset provided.\n");
 		op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
 		return -1;
Signature · 1 line
2.7.4
Acked-by on v2 1/1
#3 lore raw
Quoted 9 lines

-----Original Message-----
From: Daly, Lee
Sent: Wednesday, August 1, 2018 2:24 PM
To: De Lara Guarch, Pablo <[email protected]>
Cc: [email protected]; Daly, Lee <[email protected]>
Subject: [PATCH v2] compress/isal: fixes offset check

Quoted 7 lines

This commit fixes an offset check in decompression which was checking destination offset size against dst data_len rather than checking against dst pkt_len as required.

Fixes 788e748d3845 ("compress/isal: support chained mbufs")
#4 lore raw
Quoted 22 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of De Lara Guarch, Pablo
Sent: Wednesday, August 1, 2018 2:31 PM
To: Daly, Lee <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] compress/isal: fixes offset check

Quoted 11 lines

-----Original Message-----
From: Daly, Lee
Sent: Wednesday, August 1, 2018 2:24 PM
To: De Lara Guarch, Pablo <[email protected]>
Cc: [email protected]; Daly, Lee <[email protected]>
Subject: [PATCH v2] compress/isal: fixes offset check

This commit fixes an offset check in decompression which was checking destination offset size against dst data_len rather than checking against dst pkt_len as required.

Quoted 5 lines
Quoted 3 lines
Fixes 788e748d3845 ("compress/isal: support chained mbufs")

Applied to dpdk-next-crypto.
Thanks,

Pablo