In the Linux kernel, the following vulnerability has been resolved:
vxlan: Fix uninit-value in vxlan_vnifilter_dump()
KMSAN reported an uninit-value access in vxlan_vnifilter_dump() [1].
If the length of the netlink message payload is less than
sizeof(struct tunnel_msg), vxlan_vnifilter_dump() accesses bytes
beyond the message. This can lead to uninit-value access. Fix this by
returning an error in such situations.
[1]
BUG: KMSAN: uninit-value in vxlan_vnifilter_dump+0x328/0x920drivers/net/vxlan/vxlan_vnifilter.c:422vxlan_vnifilter_dump+0x328/0x920drivers/net/vxlan/vxlan_vnifilter.c:422rtnl_dumpit+0xd5/0x2f0net/core/rtnetlink.c:6786netlink_dump+0x93e/0x15f0net/netlink/af_netlink.c:2317__netlink_dump_start+0x716/0xd60net/netlink/af_netlink.c:2432netlink_dump_startinclude/linux/netlink.h:340[inline]rtnetlink_dump_startnet/core/rtnetlink.c:6815[inline]rtnetlink_rcv_msg+0x1256/0x14a0net/core/rtnetlink.c:6882netlink_rcv_skb+0x467/0x660net/netlink/af_netlink.c:2542rtnetlink_rcv+0x35/0x40net/core/rtnetlink.c:6944netlink_unicast_kernelnet/netlink/af_netlink.c:1321[inline]netlink_unicast+0xed6/0x1290net/netlink/af_netlink.c:1347netlink_sendmsg+0x1092/0x1230net/netlink/af_netlink.c:1891sock_sendmsg_nosecnet/socket.c:711[inline]__sock_sendmsg+0x330/0x3d0net/socket.c:726____sys_sendmsg+0x7f4/0xb50net/socket.c:2583___sys_sendmsg+0x271/0x3b0net/socket.c:2637__sys_sendmsgnet/socket.c:2669[inline]__do_sys_sendmsgnet/socket.c:2674[inline]__se_sys_sendmsgnet/socket.c:2672[inline]__x64_sys_sendmsg+0x211/0x3e0net/socket.c:2672x64_sys_call+0x3878/0x3d90arch/x86/include/generated/asm/syscalls_64.h:47do_syscall_x64arch/x86/entry/common.c:52[inline]do_syscall_64+0xd9/0x1d0arch/x86/entry/common.c:83entry_SYSCALL_64_after_hwframe+0x77/0x7fUninit was created at:slab_post_alloc_hookmm/slub.c:4110[inline]slab_alloc_nodemm/slub.c:4153[inline]kmem_cache_alloc_node_noprof+0x800/0xe80mm/slub.c:4205kmalloc_reserve+0x13b/0x4b0net/core/skbuff.c:587__alloc_skb+0x347/0x7d0net/core/skbuff.c:678alloc_skbinclude/linux/skbuff.h:1323[inline]netlink_alloc_large_skb+0xa5/0x280net/netlink/af_netlink.c:1196netlink_sendmsg+0xac9/0x1230net/netlink/af_netlink.c:1866sock_sendmsg_nosecnet/socket.c:711[inline]__sock_sendmsg+0x330/0x3d0net/socket.c:726____sys_sendmsg+0x7f4/0xb50net/socket.c:2583___sys_sendmsg+0x271/0x3b0net/socket.c:2637__sys_sendmsgnet/socket.c:2669[inline]__do_sys_sendmsgnet/socket.c:2674[inline]__se_sys_sendmsgnet/socket.c:2672[inline]__x64_sys_sendmsg+0x211/0x3e0net/socket.c:2672x64_sys_call+0x3878/0x3d90arch/x86/include/generated/asm/syscalls_64.h:47do_syscall_x64arch/x86/entry/common.c:52[inline]do_syscall_64+0xd9/0x1d0arch/x86/entry/common.c:83entry_SYSCALL_64_after_hwframe+0x77/0x7fCPU: 0 UID: 0 PID: 30991 Comm: syz.4.10630 Not tainted 6.12.0-10694-gc44daa7e3c73 #29
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-3.fc41 04/01/2014