compress/isal: fixes offset check
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.
--- drivers/compress/isal/isal_compress_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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) {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
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 checkThis commit fixes an offset check in decompression which was checking destination offset size against dst
data_lenrather than checking against dstpkt_lenas required.Fixes 788e748d3845 ("compress/isal: support chained mbufs")Signed-off-by Lee Daly <[email protected]>--- drivers/compress/isal/isal_compress_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/compress/isal/isal_compress_pmd.c +0
-0
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
-0ISAL_PMD_LOG(ERR, "Output mbuf not big enough for lengthand "
"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
PATCH v2 1/1 compress/isal: fixes offset check
In reply to Lee DalyThis 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.
--- drivers/compress/isal/isal_compress_pmd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/compress/isal/isal_compress_pmd.c +5 -5
@@ -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
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_lenrather than checking against dstpkt_lenas required.Fixes 788e748d3845 ("compress/isal: support chained mbufs")Signed-off-by Lee Daly <[email protected]>
De Lara Guarch, Pablo
AppliedQuoted 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 checkQuoted 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 checkThis commit fixes an offset check in decompression which was checking destination offset size against dst
data_lenrather than checking against dstpkt_lenas required.
Quoted 5 lines
Quoted 3 lines
Fixes 788e748d3845 ("compress/isal: support chained mbufs")Signed-off-by Lee Daly <[email protected]>Acked-by Pablo de Lara <[email protected]>
Applied to dpdk-next-crypto.
Thanks,
Pablo