================================================================== BUG: KASAN: use-after-free in ip_check_mc_rcu+0x641/0x670 net/ipv4/igmp.c:2729 Read of size 8 at addr ffff88806cbccbc8 by task syz-executor.5/9890 CPU: 0 PID: 9890 Comm: syz-executor.5 Not tainted 5.14.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 ip_check_mc_rcu+0x641/0x670 net/ipv4/igmp.c:2729 __mkroute_output net/ipv4/route.c:2524 [inline] ip_route_output_key_hash_rcu+0x18c7/0x2d00 net/ipv4/route.c:2803 ip_route_output_key_hash+0x18b/0x300 net/ipv4/route.c:2631 __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x23/0x150 net/ipv4/route.c:2863 udp_sendmsg+0x1958/0x2740 net/ipv4/udp.c:1219 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:821 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:723 ____sys_sendmsg+0x331/0x810 net/socket.c:2394 ___sys_sendmsg+0xf3/0x170 net/socket.c:2448 __sys_sendmmsg+0x195/0x470 net/socket.c:2534 __do_sys_sendmmsg net/socket.c:2563 [inline] __se_sys_sendmmsg net/socket.c:2560 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2560 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae 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:00007fce6f1f4188 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665f9 RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000003 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: ffff000000000000 R11: 0000000000000246 R12: 000000000056c038 R13: 00007ffd0b0e57ef R14: 00007fce6f1f4300 R15: 0000000000022000 Allocated by task 9861: 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:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa4/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] ip_mc_add1_src net/ipv4/igmp.c:1979 [inline] ip_mc_add_src+0x790/0xdc0 net/ipv4/igmp.c:2103 ip_mc_msfilter+0x81f/0xb50 net/ipv4/igmp.c:2487 do_ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline] ip_setsockopt+0x3285/0x3a60 net/ipv4/ip_sockglue.c:1423 tcp_setsockopt+0x136/0x24a0 net/ipv4/tcp.c:3657 __sys_setsockopt+0x2db/0x610 net/socket.c:2161 __do_sys_setsockopt net/socket.c:2172 [inline] __se_sys_setsockopt net/socket.c:2169 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2169 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 9844: 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:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1628 [inline] slab_free_freelist_hook+0xe3/0x250 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kfree+0xe4/0x540 mm/slub.c:4267 ip_mc_del1_src+0x67d/0x800 net/ipv4/igmp.c:1892 ip_mc_del_src.isra.0+0x37c/0x970 net/ipv4/igmp.c:1933 ip_mc_leave_src.isra.0+0xe9/0x250 net/ipv4/igmp.c:2239 ip_mc_drop_socket+0x11a/0x260 net/ipv4/igmp.c:2685 inet_release+0x97/0x280 net/ipv4/af_inet.c:418 __sock_release+0xcd/0x280 net/socket.c:648 sock_close+0x18/0x20 net/socket.c:1302 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88806cbccbc0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 8 bytes inside of 32-byte region [ffff88806cbccbc0, ffff88806cbccbe0) The buggy address belongs to the page: page:ffffea0001b2f300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6cbcc flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000a08cc0 0000000700000007 ffff888010841500 raw: ffff88806cbccd80 000000008040002e 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 5685, ts 765802460044, free_ts 760123748120 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4168 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5390 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 alloc_slab_page mm/slub.c:1691 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1831 new_slab mm/slub.c:1894 [inline] new_slab_objects mm/slub.c:2640 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2803 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2843 slab_alloc_node mm/slub.c:2925 [inline] slab_alloc mm/slub.c:2967 [inline] __kmalloc+0x312/0x330 mm/slub.c:4111 kmalloc include/linux/slab.h:596 [inline] sock_kmalloc net/core/sock.c:2362 [inline] sock_kmalloc+0xb5/0x100 net/core/sock.c:2353 hash_alloc_result.part.0+0x94/0x110 crypto/algif_hash.c:41 hash_alloc_result crypto/algif_hash.c:228 [inline] hash_recvmsg+0x4a1/0xa90 crypto/algif_hash.c:200 sock_recvmsg_nosec net/socket.c:943 [inline] ____sys_recvmsg+0x527/0x600 net/socket.c:2611 ___sys_recvmsg+0x127/0x200 net/socket.c:2655 do_recvmmsg+0x24d/0x6d0 net/socket.c:2749 __sys_recvmmsg net/socket.c:2828 [inline] __do_sys_recvmmsg net/socket.c:2851 [inline] __se_sys_recvmmsg net/socket.c:2844 [inline] __x64_sys_recvmmsg+0x20b/0x260 net/socket.c:2844 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page_list+0x1a1/0x1010 mm/page_alloc.c:3448 release_pages+0x824/0x20b0 mm/swap.c:972 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu mm/mmu_gather.c:249 [inline] tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:340 exit_mmap+0x1ea/0x620 mm/mmap.c:3203 __mmput+0x122/0x470 kernel/fork.c:1101 mmput+0x58/0x60 kernel/fork.c:1122 exit_mm kernel/exit.c:501 [inline] do_exit+0xae2/0x2a60 kernel/exit.c:812 do_group_exit+0x125/0x310 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88806cbcca80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88806cbccb00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff88806cbccb80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff88806cbccc00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88806cbccc80: fa fb fb fb fc fc fc fc 00 00 00 02 fc fc fc fc ==================================================================