From: Tejasree Kondoj <ktejasree@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>
Cc: Anoob Joseph <anoobj@marvell.com>,
Aakash Sasidharan <asasidharan@marvell.com>,
Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>,
Vidya Sagar Velumuri <vvelumuri@marvell.com>, <dev@dpdk.org>
Subject: [PATCH v3 1/8] crypto/cnxk: check for null pointer
Date: Tue, 20 Jun 2023 15:50:59 +0530 [thread overview]
Message-ID: <20230620102106.3970544-2-ktejasree@marvell.com> (raw)
In-Reply-To: <20230620102106.3970544-1-ktejasree@marvell.com>
Checking for NULL pointer dereference.
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
drivers/crypto/cnxk/cnxk_se.h | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h
index c66ab80749..a85e4c5170 100644
--- a/drivers/crypto/cnxk/cnxk_se.h
+++ b/drivers/crypto/cnxk/cnxk_se.h
@@ -2185,12 +2185,14 @@ fill_sess_auth(struct rte_crypto_sym_xform *xform, struct cnxk_se_sess *sess)
if (zsk_flag && sess->roc_se_ctx.auth_then_ciph) {
struct rte_crypto_cipher_xform *c_form;
- c_form = &xform->next->cipher;
- if (c_form->op != RTE_CRYPTO_CIPHER_OP_ENCRYPT &&
- a_form->op != RTE_CRYPTO_AUTH_OP_GENERATE) {
- plt_dp_err("Crypto: PDCP auth then cipher must use"
- " options: encrypt and generate");
- return -EINVAL;
+ if (xform->next != NULL) {
+ c_form = &xform->next->cipher;
+ if ((c_form != NULL) && (c_form->op != RTE_CRYPTO_CIPHER_OP_ENCRYPT) &&
+ a_form->op != RTE_CRYPTO_AUTH_OP_GENERATE) {
+ plt_dp_err("Crypto: PDCP auth then cipher must use"
+ " options: encrypt and generate");
+ return -EINVAL;
+ }
}
}
--
2.25.1
next prev parent reply other threads:[~2023-06-20 10:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 10:20 [PATCH v3 0/8] fixes and improvements to CNXK crypto PMD Tejasree Kondoj
2023-06-20 10:20 ` Tejasree Kondoj [this message]
2023-06-20 10:21 ` [PATCH v3 2/8] crypto/cnxk: remove packet length checks in crypto offload Tejasree Kondoj
2023-06-20 10:21 ` [PATCH v3 3/8] crypto/cnxk: use pt inst for null cipher with null auth Tejasree Kondoj
2023-06-20 10:21 ` [PATCH v3 4/8] crypto/cnxk: enable context cache for 103XX Tejasree Kondoj
2023-06-20 10:21 ` [PATCH v3 5/8] crypto/cnxk: add support for raw APIs Tejasree Kondoj
2023-06-23 14:25 ` Thomas Monjalon
2023-06-20 10:21 ` [PATCH v3 6/8] test/crypto: enable raw crypto tests for crypto_cn10k Tejasree Kondoj
2023-06-20 10:21 ` [PATCH v3 7/8] crypto/cnxk: add support for sm4 Tejasree Kondoj
2023-06-20 10:21 ` [PATCH v3 8/8] crypto/cnxk: fix order of ECFPM parameters Tejasree Kondoj
2023-06-20 10:26 ` [PATCH v3 0/8] fixes and improvements to CNXK crypto PMD Akhil Goyal
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=20230620102106.3970544-2-ktejasree@marvell.com \
--to=ktejasree@marvell.com \
--cc=anoobj@marvell.com \
--cc=asasidharan@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=gmuthukrishn@marvell.com \
--cc=vvelumuri@marvell.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 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).