All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] compress/isal: fixes offset check
@ 2018-07-31 11:08 Lee Daly
  2018-08-01  8:10 ` De Lara Guarch, Pablo
  2018-08-01 13:23 ` [PATCH v2] " Lee Daly
  0 siblings, 2 replies; 5+ messages in thread
From: Lee Daly @ 2018-07-31 11:08 UTC (permalink / raw)
  To: pablo.de.lara.guarch; +Cc: dev, 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")

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

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

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

* Re: [PATCH] compress/isal: fixes offset check
  2018-07-31 11:08 [PATCH] compress/isal: fixes offset check Lee Daly
@ 2018-08-01  8:10 ` De Lara Guarch, Pablo
  2018-08-01 13:23 ` [PATCH v2] " Lee Daly
  1 sibling, 0 replies; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2018-08-01  8:10 UTC (permalink / raw)
  To: Daly, Lee; +Cc: dev

Hi Lee,

> -----Original Message-----
> From: Daly, Lee
> Sent: Tuesday, July 31, 2018 12:09 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Daly, Lee <lee.daly@intel.com>
> 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")
> 
> Signed-off-by: Lee Daly <lee.daly@intel.com>
> ---
>  drivers/compress/isal/isal_compress_pmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/compress/isal/isal_compress_pmd.c
> b/drivers/compress/isal/isal_compress_pmd.c
> index e75f48d..aef56e3 100644
> --- a/drivers/compress/isal/isal_compress_pmd.c
> +++ b/drivers/compress/isal/isal_compress_pmd.c
> @@ -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.
 
>  		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.

>  		op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
> --
> 2.7.4

Thanks,
Pablo

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

* [PATCH v2] compress/isal: fixes offset check
  2018-07-31 11:08 [PATCH] compress/isal: fixes offset check Lee Daly
  2018-08-01  8:10 ` De Lara Guarch, Pablo
@ 2018-08-01 13:23 ` Lee Daly
  2018-08-01 13:30   ` De Lara Guarch, Pablo
  1 sibling, 1 reply; 5+ messages in thread
From: Lee Daly @ 2018-08-01 13:23 UTC (permalink / raw)
  To: pablo.de.lara.guarch; +Cc: dev, 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")

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

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;
-- 
2.7.4

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

* Re: [PATCH v2] compress/isal: fixes offset check
  2018-08-01 13:23 ` [PATCH v2] " Lee Daly
@ 2018-08-01 13:30   ` De Lara Guarch, Pablo
  2018-08-03  9:57     ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2018-08-01 13:30 UTC (permalink / raw)
  To: Daly, Lee; +Cc: dev



> -----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>

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

* Re: [PATCH v2] compress/isal: fixes offset check
  2018-08-01 13:30   ` De Lara Guarch, Pablo
@ 2018-08-03  9:57     ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2018-08-03  9:57 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, Daly, Lee; +Cc: dev



> -----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

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

end of thread, other threads:[~2018-08-03  9:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31 11:08 [PATCH] compress/isal: fixes offset check Lee Daly
2018-08-01  8:10 ` De Lara Guarch, Pablo
2018-08-01 13:23 ` [PATCH v2] " Lee Daly
2018-08-01 13:30   ` De Lara Guarch, Pablo
2018-08-03  9:57     ` De Lara Guarch, Pablo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.