syzbot


KASAN: slab-use-after-free Read in napi_gro_frags

Status: closed as invalid on 2025/07/30 20:31
Subsystems: net
[Documentation on labels]
First crash: 56d, last: 56d

Sample crash report:
loop0: detected capacity change from 0 to 128
usb usb5: Requested nonsensical USBDEVFS_URB_ZERO_PACKET.
syz.0.0 uses obsolete (PF_INET,SOCK_PACKET)
bridge_slave_0: left allmulticast mode
bridge_slave_0: left promiscuous mode
bridge0: port 1(bridge_slave_0) entered disabled state
bridge_slave_1: left allmulticast mode
bridge_slave_1: left promiscuous mode
bridge0: port 2(bridge_slave_1) entered disabled state
bond0: (slave bond_slave_0): Releasing backup interface
bond0: (slave bond_slave_1): Releasing backup interface
team0: Port device team_slave_0 removed
team0: Port device team_slave_1 removed
batman_adv: batadv0: Interface deactivated: batadv_slave_0
batman_adv: batadv0: Removing interface: batadv_slave_0
batman_adv: batadv0: Interface deactivated: batadv_slave_1
batman_adv: batadv0: Removing interface: batadv_slave_1
==================================================================
BUG: KASAN: slab-use-after-free in skb_reset_mac_header include/linux/skbuff.h:3086 [inline]
BUG: KASAN: slab-use-after-free in napi_frags_skb net/core/gro.c:723 [inline]
BUG: KASAN: slab-use-after-free in napi_gro_frags+0x6e/0x1030 net/core/gro.c:758
Read of size 8 at addr ffff8880437bbd58 by task syz.0.0/5329

CPU: 0 UID: 0 PID: 5329 Comm: syz.0.0 Not tainted 6.16.0-rc3-syzkaller-00072-gee88bddf7f2f #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:408 [inline]
 print_report+0xd2/0x2b0 mm/kasan/report.c:521
 kasan_report+0x118/0x150 mm/kasan/report.c:634
 skb_reset_mac_header include/linux/skbuff.h:3086 [inline]
 napi_frags_skb net/core/gro.c:723 [inline]
 napi_gro_frags+0x6e/0x1030 net/core/gro.c:758
 tun_get_user+0x27b4/0x3ce0 drivers/net/tun.c:1908
 tun_chr_write_iter+0x113/0x200 drivers/net/tun.c:1984
 do_iter_readv_writev+0x56b/0x7f0 fs/read_write.c:-1
 vfs_writev+0x31a/0x960 fs/read_write.c:1057
 do_writev+0x14d/0x2d0 fs/read_write.c:1103
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f96fb18e929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f96fbf3f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007f96fb3b5fa0 RCX: 00007f96fb18e929
RDX: 0000000000000008 RSI: 00002000000008c0 RDI: 0000000000000006
RBP: 00007f96fb210b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f96fb3b5fa0 R15: 00007ffcf8f03288
 </TASK>

Allocated by task 5329:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 unpoison_slab_object mm/kasan/common.c:319 [inline]
 __kasan_mempool_unpoison_object+0xa0/0x170 mm/kasan/common.c:547
 kasan_mempool_unpoison_object include/linux/kasan.h:388 [inline]
 napi_skb_cache_get+0x37b/0x6d0 net/core/skbuff.c:295
 __alloc_skb+0x11e/0x2d0 net/core/skbuff.c:658
 napi_alloc_skb+0x84/0x7d0 net/core/skbuff.c:812
 napi_get_frags+0x69/0x140 net/core/gro.c:673
 tun_napi_alloc_frags drivers/net/tun.c:1404 [inline]
 tun_get_user+0x71b/0x3ce0 drivers/net/tun.c:1772
 tun_chr_write_iter+0x113/0x200 drivers/net/tun.c:1984
 do_iter_readv_writev+0x56b/0x7f0 fs/read_write.c:-1
 vfs_writev+0x31a/0x960 fs/read_write.c:1057
 do_writev+0x14d/0x2d0 fs/read_write.c:1103
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 5329:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2381 [inline]
 slab_free mm/slub.c:4643 [inline]
 kmem_cache_free+0x18f/0x400 mm/slub.c:4745
 skb_pp_cow_data+0xdd8/0x13e0 net/core/skbuff.c:970
 netif_skb_check_for_xdp net/core/dev.c:5329 [inline]
 netif_receive_generic_xdp net/core/dev.c:5370 [inline]
 do_xdp_generic+0x699/0x11a0 net/core/dev.c:5438
 tun_get_user+0x23fb/0x3ce0 drivers/net/tun.c:1860
 tun_chr_write_iter+0x113/0x200 drivers/net/tun.c:1984
 do_iter_readv_writev+0x56b/0x7f0 fs/read_write.c:-1
 vfs_writev+0x31a/0x960 fs/read_write.c:1057
 do_writev+0x14d/0x2d0 fs/read_write.c:1103
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff8880437bbc80
 which belongs to the cache skbuff_head_cache of size 240
The buggy address is located 216 bytes inside of
 freed 240-byte region [ffff8880437bbc80, ffff8880437bbd70)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x437bb
flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 04fff00000000000 ffff88801bef3b40 dead000000000122 0000000000000000
raw: 0000000000000000 00000000000c000c 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5329, tgid 5328 (syz.0.0), ts 89362690965, free_ts 89354559842
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704
 prep_new_page mm/page_alloc.c:1712 [inline]
 get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3669
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419
 alloc_slab_page mm/slub.c:2451 [inline]
 allocate_slab+0x8a/0x3b0 mm/slub.c:2619
 new_slab mm/slub.c:2673 [inline]
 ___slab_alloc+0xbfc/0x1480 mm/slub.c:3859
 __slab_alloc mm/slub.c:3949 [inline]
 __slab_alloc_node mm/slub.c:4024 [inline]
 slab_alloc_node mm/slub.c:4185 [inline]
 kmem_cache_alloc_node_noprof+0x280/0x3c0 mm/slub.c:4249
 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:660
 alloc_skb include/linux/skbuff.h:1336 [inline]
 nlmsg_new include/net/netlink.h:1041 [inline]
 rtmsg_ifinfo_build_skb+0x84/0x260 net/core/rtnetlink.c:4390
 rtmsg_ifinfo_event net/core/rtnetlink.c:4432 [inline]
 rtmsg_ifinfo+0x8c/0x1a0 net/core/rtnetlink.c:4441
 netif_state_change+0x29e/0x3a0 net/core/dev.c:1586
 do_setlink+0x35de/0x41c0 net/core/rtnetlink.c:3388
 rtnl_group_changelink net/core/rtnetlink.c:3773 [inline]
 __rtnl_newlink net/core/rtnetlink.c:3927 [inline]
 rtnl_newlink+0x149f/0x1c70 net/core/rtnetlink.c:4055
 rtnetlink_rcv_msg+0x7cc/0xb70 net/core/rtnetlink.c:6944
 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2534
 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline]
 netlink_unicast+0x75b/0x8d0 net/netlink/af_netlink.c:1339
page last free pid 5303 tgid 5303 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1248 [inline]
 __free_frozen_pages+0xc71/0xe70 mm/page_alloc.c:2706
 rcu_do_batch kernel/rcu/tree.c:2576 [inline]
 rcu_core+0xca8/0x1710 kernel/rcu/tree.c:2832
 handle_softirqs+0x286/0x870 kernel/softirq.c:579
 do_softirq+0xec/0x180 kernel/softirq.c:480
 __local_bh_enable_ip+0x17d/0x1c0 kernel/softirq.c:407
 ipv6_get_lladdr+0x2aa/0x3f0 net/ipv6/addrconf.c:1937
 mld_newpack+0x420/0xc40 net/ipv6/mcast.c:1802
 add_grhead+0x5a/0x2a0 net/ipv6/mcast.c:1899
 add_grec+0x13b2/0x1670 net/ipv6/mcast.c:2037
 mld_send_cr net/ipv6/mcast.c:2163 [inline]
 mld_ifc_work+0x6e6/0xde0 net/ipv6/mcast.c:2702
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321
 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402
 kthread+0x70e/0x8a0 kernel/kthread.c:464
 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Memory state around the buggy address:
 ffff8880437bbc00: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc
 ffff8880437bbc80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880437bbd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc
                                                    ^
 ffff8880437bbd80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
 ffff8880437bbe00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/26 19:05 upstream ee88bddf7f2f 1ae8177e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: slab-use-after-free Read in napi_gro_frags
* Struck through repros no longer work on HEAD.