Re: [dpdk-dev] [PATCH] vhost: catch overflow causing mmap of size 0

2020-02-05 Thread Maxime Coquelin
On 1/16/20 11:44 AM, Maxime Coquelin wrote: > This patch catches an overflow that could happen if an > invalid region size or page alignement is provided by the > guest via the VHOST_USER_SET_MEM_TABLE request. > > If the sum of the size to mmap and the alignment overflows > uint64_t, then RTE_

Re: [dpdk-dev] [PATCH] vhost: catch overflow causing mmap of size 0

2020-01-16 Thread Tiwei Bie
On Thu, Jan 16, 2020 at 11:44:27AM +0100, Maxime Coquelin wrote: > This patch catches an overflow that could happen if an > invalid region size or page alignement is provided by the s/alignement/alignment/ > guest via the VHOST_USER_SET_MEM_TABLE request. > > If the sum of the size to mmap and t

[dpdk-dev] [PATCH] vhost: catch overflow causing mmap of size 0

2020-01-16 Thread Maxime Coquelin
This patch catches an overflow that could happen if an invalid region size or page alignement is provided by the guest via the VHOST_USER_SET_MEM_TABLE request. If the sum of the size to mmap and the alignment overflows uint64_t, then RTE_ALIGN_CEIL(mmap_size, alignment) macro will return 0. This