From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8D9EC9133; Fri, 28 Jul 2017 05:29:56 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2017 20:29:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,423,1496127600"; d="scan'208";a="292528551" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 27 Jul 2017 20:29:54 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Jul 2017 20:29:54 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Jul 2017 20:29:53 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Fri, 28 Jul 2017 11:29:51 +0800 From: "Wu, Jingjing" To: "Kozak, KubaX" CC: "dev@dpdk.org" , "Jain, Deepak K" , "Jastrzebski, MichalX K" , "stable@dpdk.org" Thread-Topic: [PATCH] net/i40e: fix dereferencing null pointer Thread-Index: AQHTBqsh0/DRvpBAmESLF/3DPCK4y6Jolg2g Date: Fri, 28 Jul 2017 03:29:50 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810DD74E0@SHSMSX103.ccr.corp.intel.com> References: <1501140502-155485-1-git-send-email-kubax.kozak@intel.com> In-Reply-To: <1501140502-155485-1-git-send-email-kubax.kozak@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWM0YzVlYTMtZWIzNy00MmNkLThhNjgtYzg2MDE3N2JhYWZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik85R3laYnVMQmpWTXpCTUxUQXFzXC9VS0ZmNDlqbVE4TjhmTHY2V3cra2FRPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH] net/i40e: fix dereferencing null pointer X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2017 03:29:57 -0000 > -----Original Message----- > From: Kozak, KubaX > Sent: Thursday, July 27, 2017 3:28 PM > To: Wu, Jingjing > Cc: dev@dpdk.org; Jain, Deepak K ; Jastrzebski, = MichalX K > ; Kozak, KubaX ; > stable@dpdk.org > Subject: [PATCH] net/i40e: fix dereferencing null pointer >=20 > Add check if o_vlan_mask and i_vlan_mask are > not a NULL pointer. >=20 > Coverity issue: 143448 > Coverity issue: 143449 > Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern") > Cc: stable@dpdk.org >=20 > Signed-off-by: Kuba Kozak > --- > drivers/net/i40e/i40e_flow.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c > index 95af701..b92719a 100644 > --- a/drivers/net/i40e/i40e_flow.c > +++ b/drivers/net/i40e/i40e_flow.c > @@ -3719,8 +3719,10 @@ i40e_flow_parse_qinq_pattern(__rte_unused struct > rte_eth_dev *dev, > } >=20 > /* Get filter specification */ > - if ((o_vlan_mask->tci =3D=3D rte_cpu_to_be_16(I40E_TCI_MASK)) && > - (i_vlan_mask->tci =3D=3D rte_cpu_to_be_16(I40E_TCI_MASK))) { > + if ((o_vlan_mask !=3D NULL) && (o_vlan_mask->tci =3D=3D > + rte_cpu_to_be_16(I40E_TCI_MASK)) && > + (i_vlan_mask !=3D NULL) && > + (i_vlan_mask->tci =3D=3D rte_cpu_to_be_16(I40E_TCI_MASK))) { > filter->outer_vlan =3D rte_be_to_cpu_16(o_vlan_spec->tci) > & I40E_TCI_MASK; > filter->inner_vlan =3D rte_be_to_cpu_16(i_vlan_spec->tci) > -- Acked-by: Jingjing Wu Thanks