All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Daly <lee.daly@intel.com>
To: pablo.de.lara.guarch@intel.com
Cc: dev@dpdk.org, Lee Daly <lee.daly@intel.com>
Subject: [PATCH v2] compress/isal: fixes offset check
Date: Wed,  1 Aug 2018 14:23:43 +0100	[thread overview]
Message-ID: <1533129823-37697-1-git-send-email-lee.daly@intel.com> (raw)
In-Reply-To: <1533035316-63812-1-git-send-email-lee.daly@intel.com>

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

  parent reply	other threads:[~2018-08-01 13:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2018-08-01 13:30   ` [PATCH v2] " De Lara Guarch, Pablo
2018-08-03  9:57     ` De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533129823-37697-1-git-send-email-lee.daly@intel.com \
    --to=lee.daly@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.