From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA11AA0C4A; Tue, 13 Jul 2021 12:27:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4195C410E6; Tue, 13 Jul 2021 12:27:23 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 9113940687 for ; Tue, 13 Jul 2021 12:27:21 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16DAQnmt018053 for ; Tue, 13 Jul 2021 03:27:20 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=DGRB+LMJvSJawKPQiUtF80/hp06y39ibRUBfbRyuhvM=; b=cDLGD6waYwQpHPAxbaE/S3fT3qKAp0YymNoO+s+N8QJLRfuA9gLYCt9rYRk0vmwF1kKi 4ZIV9GGdB0kzrlw0SVSDscYkQxIiw8isBgwk36U1G98de9QG3ZmPNuELtGrIBeOXx6E9 ma63x760/0ai/6aUD1aGuUqnHO6ZHxopgjCJGO1A7ctyQvJtW1sl+gVQS3mCwHGr0h45 vs0JeXGzW0+FKuNdyrGiP/oBZ1Oq/vheLTcNeIZOSDiavVl+zEpeiDseNdlI5Ep3FNgn 26wOYwbjvnxrlRHfD+2JiXOVcJDhJ8ercBosP2RQySpGGrefxraF/Ybr4MHpnYnZAZjj OQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 39s8n8r3j2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 13 Jul 2021 03:27:20 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 13 Jul 2021 03:27:18 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 13 Jul 2021 03:27:18 -0700 Received: from HY-LT1002.marvell.com (HY-LT1002.marvell.com [10.28.176.218]) by maili.marvell.com (Postfix) with ESMTP id 45B313F70C5; Tue, 13 Jul 2021 03:27:15 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Anoob Joseph , Ankur Dwivedi , Tejasree Kondoj , Date: Tue, 13 Jul 2021 15:57:06 +0530 Message-ID: <1626172028-100-1-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: h0x8gnzvsn4aMASKeltlZr27CIHQoL0v X-Proofpoint-ORIG-GUID: h0x8gnzvsn4aMASKeltlZr27CIHQoL0v X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-13_04:2021-07-13, 2021-07-13 signatures=0 Subject: [dpdk-dev] [PATCH 1/3] crypto/octeontx2: fix member overlap X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "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 --- 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