]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xsk: fix an integer overflow in xp_create_and_assign_umem()
authorGavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
Thu, 13 Mar 2025 08:50:08 +0000 (08:50 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2025 21:03:31 +0000 (22:03 +0100)
commit130290f44bce0eead2b827302109afc3fe189ddd
tree7ae38faaeddfd64ee50181c842b9f25e5c7f6b26
parent6afe2ea2daec156bd94ad2c5a6f4f4c48240dcd3
xsk: fix an integer overflow in xp_create_and_assign_umem()

commit 559847f56769037e5b2e0474d3dbff985b98083d upstream.

Since the i and pool->chunk_size variables are of type 'u32',
their product can wrap around and then be cast to 'u64'.
This can lead to two different XDP buffers pointing to the same
memory area.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Fixes: 94033cd8e73b ("xsk: Optimize for aligned case")
Cc: stable@vger.kernel.org
Signed-off-by: Ilia Gavrilov <Ilia.Gavrilov@infotecs.ru>
Link: https://patch.msgid.link/20250313085007.3116044-1-Ilia.Gavrilov@infotecs.ru
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xdp/xsk_buff_pool.c