DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: David Marchand <david.marchand@redhat.com>,
	Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Cc: dev@dpdk.org, reshma.pattan@intel.com, "Yigit,
	Ferruh" <ferruh.yigit@intel.com>,
	stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] eal: fix core number validation
Date: Fri, 21 Dec 2018 09:19:46 +0000	[thread overview]
Message-ID: <36ca3933-842c-8e74-ab36-c3f6809beaaa@intel.com> (raw)
In-Reply-To: <CAJFAV8xW9vjYjDX07pO8hK=vmG16wKYB9YjZHL7-xBegWkMaSA@mail.gmail.com>

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 <hari.kumarx.vemula@intel.com>
>>
> 
> 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

  reply	other threads:[~2018-12-21  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20 10:00 Hari Kumar Vemula
2018-12-21  8:27 ` David Marchand
2018-12-21  9:19   ` Burakov, Anatoly [this message]
2018-12-21  9:28     ` David Marchand
2019-01-02 12:47       ` Vemula, Hari KumarX
2019-01-02 14:23 ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36ca3933-842c-8e74-ab36-c3f6809beaaa@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=hari.kumarx.vemula@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).