================================================================== BUG: KASAN: use-after-free in ref_tracker_free+0x498/0x610 lib/ref_tracker.c:109 Read of size 1 at addr ffff88801df00a90 by task syz-executor.5/13612 CPU: 1 PID: 13612 Comm: syz-executor.5 Not tainted 5.16.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 ref_tracker_free+0x498/0x610 lib/ref_tracker.c:109 netdev_tracker_free include/linux/netdevice.h:3862 [inline] dev_put_track include/linux/netdevice.h:3879 [inline] dev_put_track include/linux/netdevice.h:3875 [inline] packet_release+0x382/0xd00 net/packet/af_packet.c:3112 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xc14/0x2b40 kernel/exit.c:832 do_group_exit+0x125/0x310 kernel/exit.c:929 get_signal+0x47d/0x2220 kernel/signal.c:2852 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f576fffee99 Code: Unable to access opcode bytes at RIP 0x7f576fffee6f. RSP: 002b:00007f576e953168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: 0000000000010000 RBX: 00007f5770112030 RCX: 00007f576fffee99 RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000005 RBP: 00007f5770058ff1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000032f01 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc0ae7b91f R14: 00007f576e953300 R15: 0000000000022000 Allocated by task 13603: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] ref_tracker_alloc+0xe1/0x430 lib/ref_tracker.c:74 netdev_tracker_alloc include/linux/netdevice.h:3854 [inline] packet_do_bind+0x35a/0xc70 net/packet/af_packet.c:3230 packet_bind+0x152/0x1b0 net/packet/af_packet.c:3297 __sys_bind+0x1e9/0x250 net/socket.c:1693 __do_sys_bind net/socket.c:1704 [inline] __se_sys_bind net/socket.c:1702 [inline] __x64_sys_bind+0x6f/0xb0 net/socket.c:1702 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 13599: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kfree+0xf6/0x560 mm/slub.c:4561 ref_tracker_free+0x31f/0x610 lib/ref_tracker.c:137 netdev_tracker_free include/linux/netdevice.h:3862 [inline] dev_put_track include/linux/netdevice.h:3879 [inline] dst_destroy+0x14f/0x400 net/core/dst.c:120 rcu_do_batch kernel/rcu/tree.c:2506 [inline] rcu_core+0x7ab/0x1470 kernel/rcu/tree.c:2741 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 The buggy address belongs to the object at ffff88801df00a80 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 16 bytes inside of 32-byte region [ffff88801df00a80, ffff88801df00aa0) The buggy address belongs to the page: page:ffffea000077c000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1df00 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001100280 dead000000000002 ffff888010c41500 raw: 0000000000000000 0000000000400040 00000001ffffffff 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 19, ts 299979250164, free_ts 299827120818 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x32d/0x4a0 mm/slub.c:1993 ___slab_alloc+0x918/0xfe0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc_trace+0x289/0x2c0 mm/slub.c:3259 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] ref_tracker_alloc+0xe1/0x430 lib/ref_tracker.c:74 netdev_tracker_alloc include/linux/netdevice.h:3854 [inline] dev_hold_track include/linux/netdevice.h:3871 [inline] dst_init+0xe0/0x520 net/core/dst.c:52 dst_alloc+0x16b/0x1f0 net/core/dst.c:96 rt_dst_alloc+0x73/0x450 net/ipv4/route.c:1614 __mkroute_output net/ipv4/route.c:2565 [inline] ip_route_output_key_hash_rcu+0x921/0x2ce0 net/ipv4/route.c:2792 ip_route_output_key_hash+0x18b/0x300 net/ipv4/route.c:2620 __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x23/0x150 net/ipv4/route.c:2851 ip_route_output_key include/net/route.h:142 [inline] sctp_v4_get_dst+0x3bd/0x11d0 net/sctp/protocol.c:448 sctp_transport_route+0x125/0x350 net/sctp/transport.c:454 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page_list+0x1a9/0xfa0 mm/page_alloc.c:3425 release_pages+0x3f4/0x1480 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu mm/mmu_gather.c:249 [inline] tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:340 exit_mmap+0x1ea/0x630 mm/mmap.c:3172 __mmput+0x122/0x4b0 kernel/fork.c:1113 mmput+0x56/0x60 kernel/fork.c:1134 exit_mm kernel/exit.c:507 [inline] do_exit+0xb27/0x2b40 kernel/exit.c:819 do_group_exit+0x125/0x310 kernel/exit.c:929 __do_sys_exit_group kernel/exit.c:940 [inline] __se_sys_exit_group kernel/exit.c:938 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:938 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88801df00980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88801df00a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff88801df00a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff88801df00b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88801df00b80: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ==================================================================