================================================================== BUG: KASAN: use-after-free in ip_check_mc_rcu+0x63a/0x6a0 net/ipv4/igmp.c:2739 Read of size 8 at addr ffff8880b2d4b580 by task syz-executor.2/14094 CPU: 1 PID: 14094 Comm: syz-executor.2 Not tainted 4.19.198-syzkaller #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+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 ip_check_mc_rcu+0x63a/0x6a0 net/ipv4/igmp.c:2739 __mkroute_output net/ipv4/route.c:2275 [inline] ip_route_output_key_hash_rcu+0x24be/0x3060 net/ipv4/route.c:2555 ip_route_output_key_hash+0x1c6/0x320 net/ipv4/route.c:2383 __ip_route_output_key include/net/route.h:124 [inline] ip_route_output_flow+0x23/0x150 net/ipv4/route.c:2640 udp_sendmsg+0x19ce/0x2550 net/ipv4/udp.c:1101 inet_sendmsg+0x132/0x5a0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:661 ___sys_sendmsg+0x3b3/0x8e0 net/socket.c:2225 __sys_sendmmsg+0x195/0x470 net/socket.c:2320 __do_sys_sendmmsg net/socket.c:2349 [inline] __se_sys_sendmmsg net/socket.c:2346 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2346 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4665e9 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:00007f0fb6c09188 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665e9 RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000007 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c038 R13: 00007ffc70fb2c2f R14: 00007f0fb6c09300 R15: 0000000000022000 Allocated by task 14105: kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] ip_mc_add1_src net/ipv4/igmp.c:1987 [inline] ip_mc_add_src+0x999/0xd50 net/ipv4/igmp.c:2111 ip_mc_source+0xa49/0x1030 net/ipv4/igmp.c:2432 do_ip_setsockopt.constprop.0+0x31d/0x3ba0 net/ipv4/ip_sockglue.c:996 ip_setsockopt+0x44/0xf0 net/ipv4/ip_sockglue.c:1246 tcp_setsockopt+0x86/0xd0 net/ipv4/tcp.c:3108 __sys_setsockopt+0x14d/0x240 net/socket.c:2011 __do_sys_setsockopt net/socket.c:2022 [inline] __se_sys_setsockopt net/socket.c:2019 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2019 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 14078: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 ip_mc_del1_src+0x654/0x7a0 net/ipv4/igmp.c:1900 ip_mc_del_src.isra.0+0x2d8/0x920 net/ipv4/igmp.c:1941 ip_mc_leave_src.isra.0+0x102/0x240 net/ipv4/igmp.c:2247 ip_mc_drop_socket+0x11a/0x260 net/ipv4/igmp.c:2701 inet_release+0x49/0x1e0 net/ipv4/af_inet.c:414 __sock_release+0xcd/0x2a0 net/socket.c:599 sock_close+0x15/0x20 net/socket.c:1212 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880b2d4b580 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff8880b2d4b580, ffff8880b2d4b5c0) The buggy address belongs to the page: page:ffffea0002cb52c0 count:1 mapcount:0 mapping:ffff88813bff0340 index:0xffff8880b2d4b300 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea00026160c8 ffffea0002863f88 ffff88813bff0340 raw: ffff8880b2d4b300 ffff8880b2d4b000 000000010000001e 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880b2d4b480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880b2d4b500: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880b2d4b580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880b2d4b600: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff8880b2d4b680: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================