Skip to content

Commit 637e3d3

Browse files
committed
xsk: fix an integer overflow in xp_create_and_assign_umem()
jira LE-3262 cve CVE-2025-21997 Rebuild_History Non-Buildable kernel-5.14.0-570.21.1.el9_6 commit-author Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru> commit 559847f 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: 94033cd ("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> (cherry picked from commit 559847f) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 85815f0 commit 637e3d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xdp/xsk_buff_pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ struct xsk_buff_pool *xp_create_and_assign_umem(struct xdp_sock *xs,
106106
if (pool->unaligned)
107107
pool->free_heads[i] = xskb;
108108
else
109-
xp_init_xskb_addr(xskb, pool, i * pool->chunk_size);
109+
xp_init_xskb_addr(xskb, pool, (u64)i * pool->chunk_size);
110110
}
111111

112112
return pool;

0 commit comments

Comments
 (0)