BUG: KASAN: use-after-free in ip_check_mc_rcu+0x307/0x3c0 net/ipv4/igmp.c:2730 Read of size 8 at addr ffff8881ee620650 by task syz-executor.5/1156 CPU: 0 PID: 1156 Comm: syz-executor.5 Not tainted 5.4.116-syzkaller-00428-g546a6e8726bc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x24e lib/dump_stack.c:118 print_address_description+0x9b/0x650 mm/kasan/report.c:384 __kasan_report+0x182/0x260 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:641 ip_check_mc_rcu+0x307/0x3c0 net/ipv4/igmp.c:2730 __mkroute_output+0x372/0x1430 net/ipv4/route.c:2357 ip_route_output_key_hash net/ipv4/route.c:2465 [inline] __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x13d/0x320 net/ipv4/route.c:2726 udp_sendmsg+0x17f6/0x2f80 net/ipv4/udp.c:1147 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] ____sys_sendmsg+0x583/0x8c0 net/socket.c:2298 ___sys_sendmsg net/socket.c:2352 [inline] __sys_sendmmsg+0x3b3/0x730 net/socket.c:2455 __do_sys_sendmmsg net/socket.c:2484 [inline] __se_sys_sendmmsg net/socket.c:2481 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2481 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x4665f9 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:00007fa8e989d188 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 00000000004665f9 RDX: 00000000080000e0 RSI: 0000000020007fc0 RDI: 0000000000000005 RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007fff29adc65f R14: 00007fa8e989d300 R15: 0000000000022000 Allocated by task 1156: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x137/0x1e0 mm/kasan/common.c:517 kmem_cache_alloc_trace+0x139/0x2b0 mm/slub.c:2848 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] ip_mc_add1_src net/ipv4/igmp.c:1973 [inline] ip_mc_add_src+0x4dd/0xa90 net/ipv4/igmp.c:2097 ip_mc_msfilter+0x6cc/0xc80 net/ipv4/igmp.c:2481 do_ip_setsockopt+0x2dc2/0x3ac0 net/ipv4/ip_sockglue.c:959 ip_setsockopt+0x4c/0xc0 net/ipv4/ip_sockglue.c:1248 __sys_setsockopt+0x56a/0x870 net/socket.c:2085 __do_sys_setsockopt net/socket.c:2101 [inline] __se_sys_setsockopt net/socket.c:2098 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2098 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 1150: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:333 [inline] __kasan_slab_free+0x18a/0x240 mm/kasan/common.c:475 slab_free_hook mm/slub.c:1454 [inline] slab_free_freelist_hook+0x7b/0x150 mm/slub.c:1492 slab_free mm/slub.c:3072 [inline] kfree+0xe0/0x660 mm/slub.c:4061 ip_mc_del1_src+0x6dd/0x7f0 net/ipv4/igmp.c:1886 ip_mc_del_src+0x398/0x7b0 net/ipv4/igmp.c:1927 ip_mc_leave_src net/ipv4/igmp.c:2233 [inline] ip_mc_drop_socket+0x199/0x3a0 net/ipv4/igmp.c:2687 inet_release+0x48/0x180 net/ipv4/af_inet.c:414 __sock_release net/socket.c:591 [inline] sock_close+0xd2/0x250 net/socket.c:1269 __fput+0x27d/0x6c0 fs/file_table.c:281 task_work_run+0x186/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop arch/x86/entry/common.c:163 [inline] prepare_exit_to_usermode+0x2b0/0x310 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8881ee620640 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 16 bytes inside of 32-byte region [ffff8881ee620640, ffff8881ee620660) The buggy address belongs to the page: page:ffffea0007b98800 refcount:1 mapcount:0 mapping:ffff8881f5c03400 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881f5c03400 raw: 0000000000000000 0000000080400040 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881ee620500: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8881ee620580: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff8881ee620600: 00 00 00 00 fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff8881ee620680: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8881ee620700: 00 00 00 04 fc fc fc fc 00 00 01 fc fc fc fc fc ==================================================================