Re: [dpdk-dev] [PATCH v2 1/2] mem: check if allocation size is too big

2018-04-30 Thread Bruce Richardson
On Mon, Apr 30, 2018 at 12:21:42PM +0100, Anatoly Burakov wrote: > Mapping size is a 64-bit integer, but mmap() will accept size_t for > size mappings. A user could request a mapping with an alignment, which > would have overflown size_t, so check if (size + alignment) will > overflow size_t. > >

[dpdk-dev] [PATCH v2 1/2] mem: check if allocation size is too big

2018-04-30 Thread Anatoly Burakov
Mapping size is a 64-bit integer, but mmap() will accept size_t for size mappings. A user could request a mapping with an alignment, which would have overflown size_t, so check if (size + alignment) will overflow size_t. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_memory.