DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] crypto/octeontx2: fix member overlap
@ 2021-07-13 10:27 Anoob Joseph
  2021-07-13 10:27 ` [dpdk-dev] [PATCH 2/3] net/octeontx2: add locking for inline IPsec tbl updates Anoob Joseph
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anoob Joseph @ 2021-07-13 10:27 UTC (permalink / raw)
  To: Akhil Goyal, Jerin Jacob
  Cc: Anoob Joseph, Ankur Dwivedi, Tejasree Kondoj, dev

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-18  8:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 10:27 [dpdk-dev] [PATCH 1/3] crypto/octeontx2: fix member overlap Anoob Joseph
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

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).