In the Linux kernel, the following vulnerability has been resolved:
gtp: pull network headers in gtp_dev_xmit()
syzbot/KMSAN reported use of uninit-value in get_dev_xmit() [1]
We must make sure the IPv4 or Ipv6 header is pulled in skb->head
before accessing fields in them.
Use pskb_inet_may_pull() to fix this issue.
[1]
BUG: KMSAN: uninit-value in ipv6_pdp_find drivers/net/gtp.c:220[inline]BUG: KMSAN: uninit-value in gtp_build_skb_ip6 drivers/net/gtp.c:1229[inline]BUG: KMSAN: uninit-value in gtp_dev_xmit+0x1424/0x2540drivers/net/gtp.c:1281ipv6_pdp_finddrivers/net/gtp.c:220[inline]gtp_build_skb_ip6drivers/net/gtp.c:1229[inline]gtp_dev_xmit+0x1424/0x2540drivers/net/gtp.c:1281__netdev_start_xmitinclude/linux/netdevice.h:4913[inline]netdev_start_xmitinclude/linux/netdevice.h:4922[inline]xmit_onenet/core/dev.c:3580[inline]dev_hard_start_xmit+0x247/0xa20net/core/dev.c:3596__dev_queue_xmit+0x358c/0x5610net/core/dev.c:4423dev_queue_xmitinclude/linux/netdevice.h:3105[inline]packet_xmit+0x9c/0x6c0net/packet/af_packet.c:276packet_sndnet/packet/af_packet.c:3145[inline]packet_sendmsg+0x90e3/0xa3a0net/packet/af_packet.c:3177sock_sendmsg_nosecnet/socket.c:730[inline]__sock_sendmsg+0x30f/0x380net/socket.c:745__sys_sendto+0x685/0x830net/socket.c:2204__do_sys_sendtonet/socket.c:2216[inline]__se_sys_sendtonet/socket.c:2212[inline]__x64_sys_sendto+0x125/0x1d0net/socket.c:2212x64_sys_call+0x3799/0x3c10arch/x86/include/generated/asm/syscalls_64.h:45do_syscall_x64arch/x86/entry/common.c:52[inline]do_syscall_64+0xcd/0x1e0arch/x86/entry/common.c:83entry_SYSCALL_64_after_hwframe+0x77/0x7fUninit was created at:slab_post_alloc_hookmm/slub.c:3994[inline]slab_alloc_nodemm/slub.c:4037[inline]kmem_cache_alloc_node_noprof+0x6bf/0xb80mm/slub.c:4080kmalloc_reserve+0x13d/0x4a0net/core/skbuff.c:583__alloc_skb+0x363/0x7b0net/core/skbuff.c:674alloc_skbinclude/linux/skbuff.h:1320[inline]alloc_skb_with_frags+0xc8/0xbf0net/core/skbuff.c:6526sock_alloc_send_pskb+0xa81/0xbf0net/core/sock.c:2815packet_alloc_skbnet/packet/af_packet.c:2994[inline]packet_sndnet/packet/af_packet.c:3088[inline]packet_sendmsg+0x749c/0xa3a0net/packet/af_packet.c:3177sock_sendmsg_nosecnet/socket.c:730[inline]__sock_sendmsg+0x30f/0x380net/socket.c:745__sys_sendto+0x685/0x830net/socket.c:2204__do_sys_sendtonet/socket.c:2216[inline]__se_sys_sendtonet/socket.c:2212[inline]__x64_sys_sendto+0x125/0x1d0net/socket.c:2212x64_sys_call+0x3799/0x3c10arch/x86/include/generated/asm/syscalls_64.h:45do_syscall_x64arch/x86/entry/common.c:52[inline]do_syscall_64+0xcd/0x1e0arch/x86/entry/common.c:83entry_SYSCALL_64_after_hwframe+0x77/0x7fCPU: 0 UID: 0 PID: 7115 Comm: syz.1.515 Not tainted 6.11.0-rc1-syzkaller-00043-g94ede2a3e913 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024