mem: fix malloc element resize with padding
authorJamie Lavigne <lavignen@amazon.com>
Thu, 8 Jun 2017 19:12:17 +0000 (19:12 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 28 Jun 2017 21:04:22 +0000 (23:04 +0200)
commit6dc931654f6cc90fdf61b278d465cbdf87f795e0
treed8ffcda362e449be8406d5c22fe79f9afe901860
parentc1923afc0999b5b6f109190bc5b69b6c3d334635
mem: fix malloc element resize with padding

Currently when a malloc_elem is split after resizing, any padding
present in the elem is ignored.  This causes the resized elem to be too
small when padding is present, and user data can overwrite the beginning
of the following malloc_elem.

Solve this by including the size of the padding when computing where to
split the malloc_elem.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Jamie Lavigne <lavignen@amazon.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
lib/librte_eal/common/malloc_elem.c