From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 96077201; Tue, 13 Nov 2018 23:40:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2018 14:40:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,230,1539673200"; d="scan'208";a="91815408" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 13 Nov 2018 14:40:57 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 13 Nov 2018 14:40:56 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 13 Nov 2018 14:40:56 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.161]) by shsmsx102.ccr.corp.intel.com ([169.254.2.84]) with mapi id 14.03.0415.000; Wed, 14 Nov 2018 06:40:54 +0800 From: "Zhang, Qi Z" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "stable@dpdk.org" , "Peng, Yuan" Thread-Topic: [PATCH] net/i40e: add parameter check for RSS flow init Thread-Index: AQHUem0VzlVK5r4dqkuSt2MmanAeUqVOTtjw Date: Tue, 13 Nov 2018 22:40:54 +0000 Message-ID: <039ED4275CED7440929022BC67E70611532E3955@SHSMSX103.ccr.corp.intel.com> References: <1542014724-68073-1-git-send-email-wei.zhao1@intel.com> In-Reply-To: <1542014724-68073-1-git-send-email-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWQyZjc3MjAtMzYzOS00OGViLWJiNWMtYmQ1MzUxOGZjNjU1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaHNqaThmSnR2N3NDYXNLbDAwbk1iVmFjVERVcWxPT2laV0diVFI0aTFqR011U1kyT0lRdzF1akhhNUtRR3M0MSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 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-dev] [PATCH] net/i40e: add parameter check for RSS flow init X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 22:40:59 -0000 > -----Original Message----- > From: Zhao1, Wei > Sent: Monday, November 12, 2018 1:25 AM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; stable@dpdk.org; Peng, Yuan > ; Zhao1, Wei > Subject: [PATCH] net/i40e: add parameter check for RSS flow init >=20 > There need an parameter check for RSS flow init, or it may cause core dum= p > if pointer is NULL in memory copy. >=20 > Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API") >=20 > Signed-off-by: Wei Zhao Acked-by: Qi Zhang Applied to dpdk-next-net-net. Thanks Qi > --- > drivers/net/i40e/i40e_ethdev.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 1c77906..217a8dc 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -12552,13 +12552,16 @@ i40e_rss_conf_init(struct > i40e_rte_flow_rss_conf *out, > if (in->key_len > RTE_DIM(out->key) || > in->queue_num > RTE_DIM(out->queue)) > return -EINVAL; > + if (!in->key && in->key_len) > + return -EINVAL; > + if (out->key && in->key) > + out->conf.key =3D memcpy(out->key, in->key, in->key_len); > out->conf =3D (struct rte_flow_action_rss){ > .func =3D in->func, > .level =3D in->level, > .types =3D in->types, > .key_len =3D in->key_len, > .queue_num =3D in->queue_num, > - .key =3D memcpy(out->key, in->key, in->key_len), > .queue =3D memcpy(out->queue, in->queue, > sizeof(*in->queue) * in->queue_num), > }; > -- > 2.7.5