patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: Gagandeep Singh <G.Singh@nxp.com>,
	dpdk-up <dpdk-up@NXP1.onmicrosoft.com>
Cc: "Akhil Goyal (OSS)" <akhil.goyal@oss.nxp.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH 11/15] crypto/dpaa2_sec: fix crypto op pointer for atomic and ordered queues
Date: Thu, 21 Apr 2022 12:05:12 +0000	[thread overview]
Message-ID: <AS8PR04MB906477A721CB050318968A4389F49@AS8PR04MB9064.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20220421120043.2565227-11-g.singh@nxp.com>

Replace Akhil with your name. 

> -----Original Message-----
> From: Gagandeep Singh <G.Singh@nxp.com>
> Sent: Thursday, April 21, 2022 5:31 PM
> To: dpdk-up <dpdk-up@NXP1.onmicrosoft.com>
> Cc: Akhil Goyal (OSS) <akhil.goyal@oss.nxp.com>; stable@dpdk.org;
> Gagandeep Singh <G.Singh@nxp.com>
> Subject: [PATCH 11/15] crypto/dpaa2_sec: fix crypto op pointer for atomic
> and ordered queues
> 
> From: Akhil Goyal <akhil.goyal@oss.nxp.com>
> 
> Driver is filling the crypto_op variable with an invalid value which can results
> into segmentation fault.
> 
> This patch assigning the correct crypto_op and event buffer pointers by
> extracting from FD.
> 
> Fixes: a77db24643b7 ("crypto/dpaa2_sec: support atomic queues")
> Fixes: 4562de326d30 ("crypto/dpaa2_sec: support ordered queue")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Akhil Goyal <akhil.goyal@oss.nxp.com>
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
>  drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> index 86c8df241b..9f2b384af9 100644
> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> @@ -4019,7 +4019,7 @@ dpaa2_sec_process_atomic_event(struct
> qbman_swp *swp __rte_unused,  {
>  	uint8_t dqrr_index;
>  	struct dpaa2_sec_qp *qp;
> -	struct rte_crypto_op *crypto_op = (struct rte_crypto_op *)ev-
> >event_ptr;
> +	struct rte_crypto_op *crypto_op;
>  	/* Prefetching mbuf */
>  	rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(fd)-
> 
> 	rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size));
> @@ -4036,12 +4036,13 @@ dpaa2_sec_process_atomic_event(struct
> qbman_swp *swp __rte_unused,
>  	ev->queue_id = rxq->ev.queue_id;
>  	ev->priority = rxq->ev.priority;
> 
> -	ev->event_ptr = sec_fd_to_mbuf(fd, qp);
> +	crypto_op = sec_fd_to_mbuf(fd, qp);
>  	dqrr_index = qbman_get_dqrr_idx(dq);
>  	*dpaa2_seqn(crypto_op->sym->m_src) =
> QBMAN_ENQUEUE_FLAG_DCA | dqrr_index;
>  	DPAA2_PER_LCORE_DQRR_SIZE++;
>  	DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index;
>  	DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = crypto_op->sym-
> >m_src;
> +	ev->event_ptr = crypto_op;
>  }
> 
>  static void __rte_hot
> @@ -4051,7 +4052,7 @@ dpaa2_sec_process_ordered_event(struct
> qbman_swp *swp,
>  				struct dpaa2_queue *rxq,
>  				struct rte_event *ev)
>  {
> -	struct rte_crypto_op *crypto_op = (struct rte_crypto_op *)ev-
> >event_ptr;
> +	struct rte_crypto_op *crypto_op;
>  	struct dpaa2_sec_qp *qp;
> 
>  	/* Prefetching mbuf */
> @@ -4069,7 +4070,7 @@ dpaa2_sec_process_ordered_event(struct
> qbman_swp *swp,
>  	ev->sched_type = rxq->ev.sched_type;
>  	ev->queue_id = rxq->ev.queue_id;
>  	ev->priority = rxq->ev.priority;
> -	ev->event_ptr = sec_fd_to_mbuf(fd, qp);
> +	crypto_op = sec_fd_to_mbuf(fd, qp);
> 
>  	*dpaa2_seqn(crypto_op->sym->m_src) =
> DPAA2_ENQUEUE_FLAG_ORP;
>  	*dpaa2_seqn(crypto_op->sym->m_src) |=
> qbman_result_DQ_odpid(dq) << @@ -4078,6 +4079,7 @@
> dpaa2_sec_process_ordered_event(struct qbman_swp *swp,
>  		DPAA2_EQCR_SEQNUM_SHIFT;
> 
>  	qbman_swp_dqrr_consume(swp, dq);
> +	ev->event_ptr = crypto_op;
>  }
> 
>  int
> --
> 2.25.1


  reply	other threads:[~2022-04-21 12:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 12:00 [PATCH 01/15] crypto/dpaa2_sec: fix fle buffer leak Gagandeep Singh
2022-04-21 12:00 ` [PATCH 02/15] crypto/dpaa2_sec: fix buffer pool ID check Gagandeep Singh
2022-04-21 12:00 ` [PATCH 03/15] crypto/dpaa_sec: fix length for chain fd in raw sec driver Gagandeep Singh
2022-04-21 12:00 ` [PATCH 04/15] crypto/dpaa2_sec: " Gagandeep Singh
2022-04-21 12:00 ` [PATCH 09/15] crypto/dpaa_sec : fix secondary process probe Gagandeep Singh
2022-04-21 12:00 ` [PATCH 11/15] crypto/dpaa2_sec: fix crypto op pointer for atomic and ordered queues Gagandeep Singh
2022-04-21 12:05   ` Hemant Agrawal [this message]
2022-04-21 12:00 ` [PATCH 12/15] crypto/dpaa2_sec: fix operation status for simple fd Gagandeep Singh
2022-04-21 12:00 ` [PATCH 15/15] common/dpaax: fix short MAC-I IV calculation for zuc Gagandeep Singh

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=AS8PR04MB906477A721CB050318968A4389F49@AS8PR04MB9064.eurprd04.prod.outlook.com \
    --to=hemant.agrawal@nxp.com \
    --cc=G.Singh@nxp.com \
    --cc=akhil.goyal@oss.nxp.com \
    --cc=dpdk-up@NXP1.onmicrosoft.com \
    --cc=stable@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).