From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 244F214EC for ; Wed, 7 Nov 2018 13:54:56 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Nov 2018 04:54:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,475,1534834800"; d="scan'208";a="84654770" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga008.fm.intel.com with ESMTP; 07 Nov 2018 04:54:55 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.144]) by IRSMSX103.ger.corp.intel.com ([169.254.3.253]) with mapi id 14.03.0415.000; Wed, 7 Nov 2018 12:54:54 +0000 From: "Ananyev, Konstantin" To: Stephen Hemminger , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC 3/5] bpf: fix validation of eal_divmod Thread-Index: AQHUdhqraOPWuQqHjU2GpN+WDdwfO6VERO7g Date: Wed, 7 Nov 2018 12:54:54 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580103069BF3@irsmsx105.ger.corp.intel.com> References: <20181106214901.1392-1-stephen@networkplumber.org> <20181106214901.1392-4-stephen@networkplumber.org> In-Reply-To: <20181106214901.1392-4-stephen@networkplumber.org> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDIyYTdjZGEtZGY3MS00ZTNhLTk4MzEtMjdlNjc1M2M1NTM4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQ0V1S3BDaGt4UWJLbXRuV1MzUDVmNzFoY0t3WVMza1NwTGxMSW1wamViejZOUXZzaTd1ak9kMFFcL3VDMXg5QjYifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC 3/5] bpf: fix validation of eal_divmod 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: Wed, 07 Nov 2018 12:54:57 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger > Sent: Tuesday, November 6, 2018 9:49 PM > To: dev@dpdk.org > Cc: Stephen Hemminger > Subject: [dpdk-dev] [RFC 3/5] bpf: fix validation of eal_divmod >=20 > Coverity spotted self assignment in BPF eval_divmod. Yep, there is one. As I remember I have to add it because one of old versions=20 of compiler (clang???) complained about 'variable being used uninitialized'= . > This looks like a bug where the incoming source register > should have been used instead. Nope, that's a wrong guess. We shouldn't do it here. Konstantin >=20 > Coverity issue: 302850 > Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program") > Signed-off-by: Stephen Hemminger > --- > lib/librte_bpf/bpf_validate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.= c > index 83983efc4e5c..b768f72c4c02 100644 > --- a/lib/librte_bpf/bpf_validate.c > +++ b/lib/librte_bpf/bpf_validate.c > @@ -512,7 +512,7 @@ eval_divmod(uint32_t op, struct bpf_reg_val *rd, stru= ct bpf_reg_val *rs, > if (op =3D=3D BPF_MOD) > rd->u.max =3D RTE_MIN(rd->u.max, rs->u.max - 1); > else > - rd->u.max =3D rd->u.max; > + rd->u.max =3D rs->u.max; > rd->u.min =3D 0; > } >=20 > -- > 2.17.1