[v2] compress/isal: fixes offset check

Message ID 1533129823-37697-1-git-send-email-lee.daly@intel.com
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers show
Series
  • [v2] compress/isal: fixes offset check
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Daly, Lee Aug. 1, 2018, 1:23 p.m.
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")

Signed-off-by: Lee Daly <lee.daly@intel.com>
---
 drivers/compress/isal/isal_compress_pmd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

De Lara Guarch, Pablo Aug. 1, 2018, 1:30 p.m. | #1
> -----Original Message-----
> From: Daly, Lee
> Sent: Wednesday, August 1, 2018 2:24 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Daly, Lee <lee.daly@intel.com>
> 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.
> 
> Fixes:788e748d3845 ("compress/isal: support chained mbufs")
> 
> Signed-off-by: Lee Daly <lee.daly@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
De Lara Guarch, Pablo Aug. 3, 2018, 9:57 a.m. | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch, Pablo
> Sent: Wednesday, August 1, 2018 2:31 PM
> To: Daly, Lee <lee.daly@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] compress/isal: fixes offset check
> 
> 
> 
> > -----Original Message-----
> > From: Daly, Lee
> > Sent: Wednesday, August 1, 2018 2:24 PM
> > To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> > Cc: dev@dpdk.org; Daly, Lee <lee.daly@intel.com>
> > 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.
> >
> > Fixes:788e748d3845 ("compress/isal: support chained mbufs")
> >
> > Signed-off-by: Lee Daly <lee.daly@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo

Patch

diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c
index e75f48d..e943336 100644
--- a/drivers/compress/isal/isal_compress_pmd.c
+++ b/drivers/compress/isal/isal_compress_pmd.c
@@ -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;