Re: [dpdk-dev] [PATCH v3] mem: fix the alloc size roundup overflow

2020-05-11 Thread David Marchand
On Thu, May 7, 2020 at 10:03 AM Bing Zhao wrote: > > The size checking is done in the caller. The size parameter is an > unsigned (64b wide) right now, so the comparison with zero should be > enough in most cases. But it won't help in the following case. > If the allocating request input a huge nu

[dpdk-dev] [PATCH v3] mem: fix the alloc size roundup overflow

2020-05-07 Thread Bing Zhao
The size checking is done in the caller. The size parameter is an unsigned (64b wide) right now, so the comparison with zero should be enough in most cases. But it won't help in the following case. If the allocating request input a huge number by mistake, e.g., some overflow after the calculation (