================================================================== BUG: KASAN: use-after-free in ip_check_mc_rcu+0x5c7/0x600 net/ipv4/igmp.c:2722 Read of size 8 at addr ffff888146eac148 by task syz-executor.5/17095 CPU: 1 PID: 17095 Comm: syz-executor.5 Tainted: G W 5.14.0-rc1-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+0x1ae/0x29f lib/dump_stack.c:105 print_address_description+0x66/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x163/0x210 mm/kasan/report.c:436 ip_check_mc_rcu+0x5c7/0x600 net/ipv4/igmp.c:2722 __mkroute_output net/ipv4/route.c:2524 [inline] ip_route_output_key_hash_rcu+0xf3f/0x2570 net/ipv4/route.c:2803 ip_route_output_key_hash+0x1b7/0x300 net/ipv4/route.c:2631 __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x25/0x130 net/ipv4/route.c:2863 udp_sendmsg+0x1cf1/0x3260 net/ipv4/udp.c:1206 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] ____sys_sendmsg+0x5a2/0x900 net/socket.c:2392 ___sys_sendmsg net/socket.c:2446 [inline] __sys_sendmmsg+0x500/0x790 net/socket.c:2532 __do_sys_sendmmsg net/socket.c:2561 [inline] __se_sys_sendmmsg net/socket.c:2558 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2558 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665d9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f13b4349188 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665d9 RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000003 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c038 R13: 00007fffce77d70f R14: 00007f13b4349300 R15: 0000000000022000 Allocated by task 17091: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xc4/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:263 [inline] kmem_cache_alloc_trace+0x96/0x340 mm/slub.c:3008 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] ip_mc_add1_src net/ipv4/igmp.c:1972 [inline] ip_mc_add_src+0x766/0xd80 net/ipv4/igmp.c:2096 ip_mc_msfilter+0x691/0xc50 net/ipv4/igmp.c:2480 do_ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline] ip_setsockopt+0x3ea4/0x54a0 net/ipv4/ip_sockglue.c:1423 __sys_setsockopt+0x552/0x980 net/socket.c:2159 __do_sys_setsockopt net/socket.c:2170 [inline] __se_sys_setsockopt net/socket.c:2167 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2167 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 17084: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x109/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:229 [inline] slab_free_hook mm/slub.c:1650 [inline] slab_free_freelist_hook+0x1d8/0x290 mm/slub.c:1675 slab_free mm/slub.c:3235 [inline] kfree+0xcf/0x2d0 mm/slub.c:4295 ip_mc_del1_src+0x6ff/0x860 net/ipv4/igmp.c:1885 ip_mc_del_src+0x636/0xa40 net/ipv4/igmp.c:1926 ip_mc_leave_src+0x10b/0x200 net/ipv4/igmp.c:2232 ip_mc_drop_socket+0x198/0x260 net/ipv4/igmp.c:2678 inet_release+0x82/0x1f0 net/ipv4/af_inet.c:418 __sock_release net/socket.c:648 [inline] sock_close+0xd8/0x260 net/socket.c:1300 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888146eac140 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 8 bytes inside of 32-byte region [ffff888146eac140, ffff888146eac160) The buggy address belongs to the page: page:ffffea00051bab00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x146eac flags: 0x57ff00000000200(slab|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000000200 ffffea00009fd040 0000001500000015 ffff888011041500 raw: 0000000000000000 0000000080400040 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 8357511465, free_ts 0 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4166 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5374 alloc_page_interleave+0x22/0x1c0 mm/mempolicy.c:2119 alloc_slab_page mm/slub.c:1713 [inline] allocate_slab+0xf1/0x540 mm/slub.c:1853 new_slab mm/slub.c:1916 [inline] new_slab_objects mm/slub.c:2662 [inline] ___slab_alloc+0x1cf/0x350 mm/slub.c:2825 __slab_alloc mm/slub.c:2865 [inline] slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2989 [inline] kmem_cache_alloc_trace+0x29d/0x340 mm/slub.c:3006 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] alloc_workqueue_attrs kernel/workqueue.c:3365 [inline] apply_wqattrs_prepare+0xe8/0xdc0 kernel/workqueue.c:3930 apply_workqueue_attrs_locked kernel/workqueue.c:4040 [inline] apply_workqueue_attrs+0xc9/0x170 kernel/workqueue.c:4077 alloc_and_link_pwqs kernel/workqueue.c:4195 [inline] alloc_workqueue+0xef4/0x1450 kernel/workqueue.c:4309 usbip_init_eh+0x27/0x60 drivers/usb/usbip/usbip_event.c:130 do_one_initcall+0x197/0x3f0 init/main.c:1282 do_initcall_level+0x14a/0x1f5 init/main.c:1355 do_initcalls+0x4b/0x8c init/main.c:1371 kernel_init_freeable+0x3f1/0x57e init/main.c:1593 kernel_init+0x19/0x2a0 init/main.c:1485 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page_owner free stack trace missing Memory state around the buggy address: ffff888146eac000: fa fb fb fb fc fc fc fc 00 00 01 fc fc fc fc fc ffff888146eac080: 00 00 00 fc fc fc fc fc 00 00 00 00 fc fc fc fc >ffff888146eac100: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff888146eac180: 00 00 01 fc fc fc fc fc 00 00 00 00 fc fc fc fc ffff888146eac200: 00 00 00 01 fc fc fc fc 00 00 00 00 fc fc fc fc ==================================================================