================================================================== BUG: KASAN: use-after-free in ip_check_mc_rcu+0x4db/0x540 net/ipv4/igmp.c:2697 Read of size 8 at addr ffff88809cd83e80 by task syz-executor216/11821 CPU: 0 PID: 11821 Comm: syz-executor216 Not tainted 4.14.221-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351 kasan_report mm/kasan/report.c:409 [inline] __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430 ip_check_mc_rcu+0x4db/0x540 net/ipv4/igmp.c:2697 __mkroute_output net/ipv4/route.c:2234 [inline] ip_route_output_key_hash_rcu+0x1f25/0x29f0 net/ipv4/route.c:2516 ip_route_output_key_hash+0x195/0x2a0 net/ipv4/route.c:2344 __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x23/0x130 net/ipv4/route.c:2601 udp_sendmsg+0x13b5/0x1c80 net/ipv4/udp.c:1025 inet_sendmsg+0x11a/0x4e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 ___sys_sendmsg+0x326/0x800 net/socket.c:2062 __sys_sendmmsg+0x129/0x330 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0x2f/0x50 net/socket.c:2178 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x448fe9 RSP: 002b:00007f5bd8415318 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00000000004ce4e8 RCX: 0000000000448fe9 RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000003 RBP: 00000000004ce4e0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049d484 R13: 00007ffd9fc4378f R14: 00007f5bd8415400 R15: 0000000000022000 Allocated by task 11821: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] ip_mc_add1_src net/ipv4/igmp.c:1960 [inline] ip_mc_add_src+0x8d5/0xbd0 net/ipv4/igmp.c:2084 ip_mc_source+0x8bf/0xe20 net/ipv4/igmp.c:2390 do_ip_setsockopt.constprop.0+0x2fd/0x2900 net/ipv4/ip_sockglue.c:995 ip_setsockopt+0x36/0xb0 net/ipv4/ip_sockglue.c:1248 tcp_setsockopt+0x7b/0xc0 net/ipv4/tcp.c:2828 SYSC_setsockopt net/socket.c:1865 [inline] SyS_setsockopt+0x110/0x1e0 net/socket.c:1844 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 11820: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xc9/0x250 mm/slab.c:3815 ip_mc_del1_src+0x586/0x6d0 net/ipv4/igmp.c:1873 ip_mc_del_src.isra.0+0x2da/0x7f0 net/ipv4/igmp.c:1914 ip_mc_leave_src.isra.0+0xeb/0x210 net/ipv4/igmp.c:2205 ip_mc_drop_socket+0x10a/0x220 net/ipv4/igmp.c:2659 inet_release+0x47/0x1b0 net/ipv4/af_inet.c:411 __sock_release+0xcd/0x2b0 net/socket.c:602 sock_close+0x15/0x20 net/socket.c:1139 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff88809cd83e80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88809cd83e80, ffff88809cd83ec0) The buggy address belongs to the page: page:ffffea00027360c0 count:1 mapcount:0 mapping:ffff88809cd83000 index:0xffff88809cd83f80 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffff88809cd83000 ffff88809cd83f80 0000000100000019 raw: ffffea0002d4f1e0 ffffea00024eb960 ffff88813fe80340 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809cd83d80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff88809cd83e00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88809cd83e80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88809cd83f00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88809cd83f80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================