mem: check if allocation size is too big
authorAnatoly Burakov <anatoly.burakov@intel.com>
Mon, 30 Apr 2018 11:21:42 +0000 (12:21 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 13 May 2018 23:32:21 +0000 (01:32 +0200)
commit91fe57ac0010324510d9e6532daf79b5bc50ed6c
tree95d12f8ef01de67d9ed0e972af8eb77705bb9712
parentc9d034d873ce6de9681eac3586428f24ab196bc4
mem: check if allocation size is too big

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 <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/common/eal_common_memory.c