Commit eefb11fb authored by Kal Conley's avatar Kal Conley Committed by sanglipeng
Browse files

xsk: Add missing overflow check in xdp_umem_reg

stable inclusion
from stable-v5.10.177
commit 580634b03a55f04a3c1968bcbd97736c079c6601
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=580634b03a55f04a3c1968bcbd97736c079c6601



--------------------------------

[ Upstream commit c7df4813 ]

The number of chunks can overflow u32. Make sure to return -EINVAL on
overflow. Also remove a redundant u32 cast assigning umem->npgs.

Fixes: bbff2f32 ("xsk: new descriptor addressing scheme")
Signed-off-by: default avatarKal Conley <kal.conley@dectris.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20230308174013.1114745-1-kal.conley@dectris.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent abe7e60e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment