================================================================== BUG: KASAN: use-after-free in ip_check_mc_rcu+0x604/0x660 net/ipv4/igmp.c:2716 Read of size 4 at addr ffff88807a5049d8 by task syz-executor.2/20206 CPU: 0 PID: 20206 Comm: syz-executor.2 Not tainted 5.11.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 ip_check_mc_rcu+0x604/0x660 net/ipv4/igmp.c:2716 __mkroute_output net/ipv4/route.c:2400 [inline] ip_route_output_key_hash_rcu+0x1959/0x2ce0 net/ipv4/route.c:2679 ip_route_output_key_hash+0x1a4/0x2f0 net/ipv4/route.c:2507 __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x23/0x150 net/ipv4/route.c:2768 udp_sendmsg+0x1a21/0x2720 net/ipv4/udp.c:1200 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:817 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 ____sys_sendmsg+0x331/0x810 net/socket.c:2345 ___sys_sendmsg+0xf3/0x170 net/socket.c:2399 __sys_sendmmsg+0x195/0x470 net/socket.c:2489 __do_sys_sendmmsg net/socket.c:2518 [inline] __se_sys_sendmmsg net/socket.c:2515 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2515 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45e219 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f2f62944c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 000000000045e219 RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000003 RBP: 000000000119c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000006000 R11: 0000000000000246 R12: 000000000119c034 R13: 00007ffdca44456f R14: 00007f2f629459c0 R15: 000000000119c034 Allocated by task 20181: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:682 [inline] ip_mc_add1_src net/ipv4/igmp.c:1971 [inline] ip_mc_add_src+0x7f8/0xdb0 net/ipv4/igmp.c:2095 ip_mc_msfilter+0x899/0xb40 net/ipv4/igmp.c:2479 do_ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline] ip_setsockopt+0x3263/0x3a20 net/ipv4/ip_sockglue.c:1423 tcp_setsockopt+0x136/0x2440 net/ipv4/tcp.c:3598 __sys_setsockopt+0x2db/0x610 net/socket.c:2115 __do_sys_setsockopt net/socket.c:2126 [inline] __se_sys_setsockopt net/socket.c:2123 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2123 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 20178: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580 slab_free mm/slub.c:3142 [inline] kfree+0xdb/0x3b0 mm/slub.c:4124 ip_sf_list_clear_all net/ipv4/igmp.c:191 [inline] ip_mc_clear_src+0x131/0x1d0 net/ipv4/igmp.c:2148 __ip_mc_dec_group+0x42d/0x4f0 net/ipv4/igmp.c:1675 ip_mc_dec_group include/linux/igmp.h:138 [inline] ip_mc_drop_socket+0x150/0x260 net/ipv4/igmp.c:2679 inet_release+0x97/0x280 net/ipv4/af_inet.c:418 __sock_release+0xcd/0x280 net/socket.c:597 sock_close+0x18/0x20 net/socket.c:1256 __fput+0x283/0x920 fs/file_table.c:280 task_work_run+0xdd/0x190 kernel/task_work.c:140 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:302 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88807a5049c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 24 bytes inside of 32-byte region [ffff88807a5049c0, ffff88807a5049e0) The buggy address belongs to the page: page:00000000eae4f07f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a504 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000926240 0000000e0000000e ffff888010041a00 raw: 0000000000000000 0000000000400040 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88807a504880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88807a504900: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc >ffff88807a504980: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff88807a504a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88807a504a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ==================================================================