================================================================== BUG: KASAN: use-after-free in ip_check_mc_rcu+0x63a/0x6a0 net/ipv4/igmp.c:2738 Read of size 8 at addr ffff88809d4a2d00 by task syz-executor.4/15323 CPU: 1 PID: 15323 Comm: syz-executor.4 Not tainted 4.19.184-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:2738 __mkroute_output net/ipv4/route.c:2267 [inline] ip_route_output_key_hash_rcu+0x24be/0x3060 net/ipv4/route.c:2547 ip_route_output_key_hash+0x1c6/0x320 net/ipv4/route.c:2375 __ip_route_output_key include/net/route.h:124 [inline] ip_route_output_flow+0x23/0x150 net/ipv4/route.c:2632 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:622 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:632 ___sys_sendmsg+0x3b3/0x8e0 net/socket.c:2115 __sys_sendmmsg+0x195/0x470 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2236 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466459 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:00007f6b8bb9e188 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 000000000056c158 RCX: 0000000000466459 RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000004 RBP: 00000000004bf9fb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c158 R13: 00007ffd8a85dcaf R14: 00007f6b8bb9e300 R15: 0000000000022000 Allocated by task 15322: 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:1986 [inline] ip_mc_add_src+0x999/0xd50 net/ipv4/igmp.c:2110 ip_mc_source+0xa49/0x1030 net/ipv4/igmp.c:2431 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:1901 __do_sys_setsockopt net/socket.c:1912 [inline] __se_sys_setsockopt net/socket.c:1909 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:1909 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 15304: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 ip_mc_del1_src+0x654/0x7a0 net/ipv4/igmp.c:1899 ip_mc_del_src.isra.0+0x2d8/0x920 net/ipv4/igmp.c:1940 ip_mc_leave_src.isra.0+0x102/0x240 net/ipv4/igmp.c:2246 ip_mc_drop_socket+0x11a/0x260 net/ipv4/igmp.c:2700 inet_release+0x49/0x1e0 net/ipv4/af_inet.c:414 __sock_release+0xcd/0x2a0 net/socket.c:579 sock_close+0x15/0x20 net/socket.c:1140 __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 ffff88809d4a2d00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88809d4a2d00, ffff88809d4a2d40) The buggy address belongs to the page: page:ffffea0002752880 count:1 mapcount:0 mapping:ffff88813bff0340 index:0xffff88809d4a2b00 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea0002a89088 ffffea0002753988 ffff88813bff0340 raw: ffff88809d4a2b00 ffff88809d4a2000 000000010000000f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809d4a2c00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88809d4a2c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88809d4a2d00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88809d4a2d80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88809d4a2e00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================