[dpdk-dev] [PATCH] eal: fix core number validation

Burakov, Anatoly anatoly.burakov at intel.com
Fri Dec 21 10:19:46 CET 2018


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 at 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 at dpdk.org
>>
>> Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula at 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 at 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 at 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 at 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


More information about the dev mailing list