[dpdk-dev] [PATCH] net/af_xdp: fix integer overflow in umem size calculation

Ferruh Yigit ferruh.yigit at intel.com
Fri Oct 30 16:01:34 CET 2020


On 10/29/2020 12:41 PM, Martin Weiser wrote:
> Hi,
> 
> the reason why I stumbled across this issue is because I was getting
> inconsistent errors during interface rx queue setup.
> We generally use quite large mempools and it looks like the umem setup
> fails for larger sizes. But because of the integer overflow the
> umem_size sometimes became small enough to let the umem setup work, so
> it was not immediately obvious what was going wrong.
> 
> It seems that the umem setup (specifically the setsockopt call with
> XDP_UMEM_REG in libbpf's xsk_umem__create_v0_0_4()) fails with any
> length greater than 2GB and returns ENOMEM. This at least happens on our
> systems with kernel 5.8.
> Are you aware of any such kernel-side limitation? This basically makes
> af_xdp unusable with mempools larger than 2GB.
> 
> Best regards,
> Martin
> 
> 
> Am 29.10.20 um 12:25 schrieb Martin Weiser:
>> The multiplication of two u32 integers may cause an overflow with large
>> mempool sizes.
>>
>> Fixes: 74b46340e2d4 ("net/af_xdp: support shared UMEM")
>> Cc: ciara.loftus at intel.com
>>
>> Signed-off-by: Martin Weiser <martin.weiser at allegro-packets.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>

Applied to dpdk-next-net/main, thanks.


More information about the dev mailing list