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 B4FF71B1E9; Fri, 21 Dec 2018 10:19:49 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2018 01:19:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,380,1539673200"; d="scan'208";a="131831777" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.252.9.59]) ([10.252.9.59]) by fmsmga001.fm.intel.com with ESMTP; 21 Dec 2018 01:19:47 -0800 To: David Marchand , Hari Kumar Vemula Cc: dev@dpdk.org, reshma.pattan@intel.com, "Yigit, Ferruh" , stable@dpdk.org References: <1545300049-7463-1-git-send-email-hari.kumarx.vemula@intel.com> From: "Burakov, Anatoly" Message-ID: <36ca3933-842c-8e74-ab36-c3f6809beaaa@intel.com> Date: Fri, 21 Dec 2018 09:19:46 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: fix core number validation 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: Fri, 21 Dec 2018 09:19:50 -0000 On 21-Dec-18 8:27 AM, David Marchand wrote: > On Thu, Dec 20, 2018 at 11:01 AM Hari Kumar Vemula < > hari.kumarx.vemula@intel.com> wrote: > >> When incorrect core value or range provided, >> as part of -l command line option, a crash occurs. >> >> Added valid range checks to fix the crash. >> >> Fixes: d888cb8b9613 ("eal: add core list input format") >> Cc: stable@dpdk.org >> >> Signed-off-by: Hari Kumar Vemula >> > > Thanks for reporting. > I agree that some validation steps are missing, but I tried a little bit > and did not reproduce a crash. > > On my 8 cores system: > [dmarchan@dmarchan dpdk]$ ./master/app/testpmd --no-huge -l > 567890,567891,567892 -m 512 --log-level *:debug -- -i --total-num-mbufs 2048 > [...] > EAL: Support maximum 128 logical core(s) by configuration. > EAL: Detected 8 lcore(s) > [...] > EAL: invalid core list > > Usage: ./master/app/testpmd [options] > etc... > > > [dmarchan@dmarchan dpdk]$ ./master/app/testpmd --no-huge -l 2,3,-1 -m 512 > --log-level *:debug -- -i --total-num-mbufs 2048 > [...] > EAL: Support maximum 128 logical core(s) by configuration. > EAL: Detected 8 lcore(s) > EAL: Detected 1 NUMA nodes > [...] > Done > testpmd> > Bye... > > Idem with > > [dmarchan@dmarchan dpdk]$ ./master/app/testpmd --no-huge -l 2,3,567890 -m > 512 --log-level *:debug -- -i --total-num-mbufs 2048 > [...] > EAL: Support maximum 128 logical core(s) by configuration. > EAL: Detected 8 lcore(s) > EAL: Detected 1 NUMA nodes > [...] > Done > testpmd> > Bye... > > > Since you have identified a potential crash, can you give an example of > such a crash ? > Besides, we have tests that check arguments, so an update of the test would > be nice. > > Thanks. > I believe these lcore numbers are used to index the lcore list later, which would cause out-of-bounds access, which may or may not cause a crash, depending on how lucky you get. -- Thanks, Anatoly