patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@nvidia.com>
To: Gagandeep Singh <g.singh@nxp.com>, "stable@dpdk.org" <stable@dpdk.org>
Cc: Akhil Goyal <gakhil@marvell.com>
Subject: RE: [PATCH 20.11] crypto/dpaa2_sec: fix crypto operation pointer
Date: Tue, 19 Jul 2022 11:11:21 +0000	[thread overview]
Message-ID: <DM4PR12MB5373C33E0D3800E3423E656BA18F9@DM4PR12MB5373.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20220628034410.1522591-1-g.singh@nxp.com>

Thanks, patch applied.

> -----Original Message-----
> From: Gagandeep Singh <g.singh@nxp.com>
> Sent: Tuesday, June 28, 2022 11:44 AM
> To: stable@dpdk.org
> Cc: Gagandeep Singh <g.singh@nxp.com>; Akhil Goyal <gakhil@marvell.com>
> Subject: [PATCH 20.11] crypto/dpaa2_sec: fix crypto operation pointer
> 
> [ upstream commit e3d264383b560a447806d9ff478bad234fda5675 ]
> 
> Driver is filling the crypto_op variable with an invalid value for atomic events 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")
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> Acked-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> index 64ee56e7c..839c11ed2 100644
> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> @@ -3705,7 +3705,7 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
>  				 struct rte_event *ev)
>  {
>  	uint8_t dqrr_index;
> -	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));
> @@ -3721,12 +3721,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);
> +	crypto_op = sec_fd_to_mbuf(fd);
>  	dqrr_index = qbman_get_dqrr_idx(dq);
>  	*dpaa2_seqn(crypto_op->sym->m_src) = dqrr_index + 1;
>  	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;
>  }
> 
>  int
> --
> 2.25.1


      reply	other threads:[~2022-07-19 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  3:44 Gagandeep Singh
2022-07-19 11:11 ` Xueming(Steven) Li [this message]

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=DM4PR12MB5373C33E0D3800E3423E656BA18F9@DM4PR12MB5373.namprd12.prod.outlook.com \
    --to=xuemingl@nvidia.com \
    --cc=g.singh@nxp.com \
    --cc=gakhil@marvell.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).