Skip to content

Commit ea453b2

Browse files
committed
xsk: fix an integer overflow in xp_create_and_assign_umem()
JIRA: https://issues.redhat.com/browse/RHEL-84579 JIRA: https://issues.redhat.com/browse/RHEL-87910 CVE: CVE-2025-21997 commit 559847f Author: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru> Date: Thu Mar 13 08:50:08 2025 +0000 xsk: fix an integer overflow in xp_create_and_assign_umem() 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> Signed-off-by: Felix Maurer <fmaurer@redhat.com>
1 parent be17a66 commit ea453b2

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)