DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anoob Joseph <anoobj@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>, Jerin Jacob <jerinj@marvell.com>
Cc: Anoob Joseph <anoobj@marvell.com>,
	Ankur Dwivedi <adwivedi@marvell.com>,
	Tejasree Kondoj <ktejasree@marvell.com>, <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 1/3] crypto/octeontx2: fix member overlap
Date: Tue, 13 Jul 2021 15:57:06 +0530	[thread overview]
Message-ID: <1626172028-100-1-git-send-email-anoobj@marvell.com> (raw)

The member 'dir' should not overlap with 'ip'. Usage of union for all
members would mean dir would get corrupt.

Fixes: e91b4f45ff54 ("net/octeontx2: support anti-replay for security session")
Cc: adwivedi@marvell.com

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/crypto/octeontx2/otx2_security.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/octeontx2/otx2_security.h b/drivers/crypto/octeontx2/otx2_security.h
index 9f1ba71..29c8fc3 100644
--- a/drivers/crypto/octeontx2/otx2_security.h
+++ b/drivers/crypto/octeontx2/otx2_security.h
@@ -20,14 +20,16 @@
 #define OTX2_SEC_AES_GCM_ROUNDUP_BYTE_LEN	4
 #define OTX2_SEC_AES_CBC_ROUNDUP_BYTE_LEN	16
 
-union otx2_sec_session_ipsec {
-	struct otx2_sec_session_ipsec_ip ip;
-	struct otx2_sec_session_ipsec_lp lp;
+struct otx2_sec_session_ipsec {
+	union {
+		struct otx2_sec_session_ipsec_ip ip;
+		struct otx2_sec_session_ipsec_lp lp;
+	};
 	enum rte_security_ipsec_sa_direction dir;
 };
 
 struct otx2_sec_session {
-	union otx2_sec_session_ipsec ipsec;
+	struct otx2_sec_session_ipsec ipsec;
 	void *userdata;
 	/**< Userdata registered by the application */
 } __rte_cache_aligned;
-- 
2.7.4


             reply	other threads:[~2021-07-13 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 10:27 Anoob Joseph [this message]
2021-07-13 10:27 ` [dpdk-dev] [PATCH 2/3] net/octeontx2: add locking for inline IPsec tbl updates Anoob Joseph
2021-07-13 10:27 ` [dpdk-dev] [PATCH 3/3] net/octeontx2: clear SA valid during session destroy Anoob Joseph
2021-07-18  8:33 ` [dpdk-dev] [PATCH 1/3] crypto/octeontx2: fix member overlap 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=1626172028-100-1-git-send-email-anoobj@marvell.com \
    --to=anoobj@marvell.com \
    --cc=adwivedi@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=ktejasree@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).