==================================================================
BUG: KASAN: use-after-free in ip_check_mc_rcu+0x654/0x660 net/ipv4/igmp.c:2720
Read of size 8 at addr ffff888022287b10 by task syz-executor.5/30542

CPU: 0 PID: 30542 Comm: syz-executor.5 Not tainted 5.12.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:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232
 __kasan_report mm/kasan/report.c:399 [inline]
 kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416
 ip_check_mc_rcu+0x654/0x660 net/ipv4/igmp.c:2720
 __mkroute_output net/ipv4/route.c:2405 [inline]
 ip_route_output_key_hash_rcu+0x1959/0x2ce0 net/ipv4/route.c:2684
 ip_route_output_key_hash+0x1a4/0x2f0 net/ipv4/route.c:2512
 __ip_route_output_key include/net/route.h:126 [inline]
 ip_route_output_flow+0x23/0x150 net/ipv4/route.c:2744
 udp_sendmsg+0x1a2f/0x2730 net/ipv4/udp.c:1206
 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:821
 sock_sendmsg_nosec net/socket.c:654 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:674
 ____sys_sendmsg+0x331/0x810 net/socket.c:2350
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2404
 __sys_sendmmsg+0x297/0x470 net/socket.c:2483
 __compat_sys_sendmmsg net/compat.c:361 [inline]
 __do_compat_sys_sendmmsg net/compat.c:368 [inline]
 __se_compat_sys_sendmmsg net/compat.c:365 [inline]
 __ia32_compat_sys_sendmmsg+0x9b/0x100 net/compat.c:365
 do_syscall_32_irqs_on arch/x86/entry/common.c:77 [inline]
 __do_fast_syscall_32+0x56/0x90 arch/x86/entry/common.c:140
 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:165
 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
RIP: 0023:0xf7fe5549
Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f55df5fc EFLAGS: 00000296 ORIG_RAX: 0000000000000159
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000020007fc0
RDX: 000000000800001d RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 30542:
 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:427 [inline]
 ____kasan_kmalloc mm/kasan/common.c:506 [inline]
 ____kasan_kmalloc mm/kasan/common.c:465 [inline]
 __kasan_kmalloc+0x99/0xc0 mm/kasan/common.c:515
 kmalloc include/linux/slab.h:554 [inline]
 kzalloc include/linux/slab.h:684 [inline]
 ip_mc_add1_src net/ipv4/igmp.c:1971 [inline]
 ip_mc_add_src+0x7ef/0xda0 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+0x3248/0x3a00 net/ipv4/ip_sockglue.c:1423
 tcp_setsockopt+0x136/0x24a0 net/ipv4/tcp.c:3643
 __sys_setsockopt+0x2db/0x610 net/socket.c:2117
 __do_sys_setsockopt net/socket.c:2128 [inline]
 __se_sys_setsockopt net/socket.c:2125 [inline]
 __ia32_sys_setsockopt+0xb9/0x150 net/socket.c:2125
 do_syscall_32_irqs_on arch/x86/entry/common.c:77 [inline]
 __do_fast_syscall_32+0x56/0x90 arch/x86/entry/common.c:140
 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:165
 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c

Freed by task 30537:
 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:357
 ____kasan_slab_free mm/kasan/common.c:360 [inline]
 ____kasan_slab_free mm/kasan/common.c:325 [inline]
 __kasan_slab_free+0xf5/0x130 mm/kasan/common.c:367
 kasan_slab_free include/linux/kasan.h:199 [inline]
 slab_free_hook mm/slub.c:1562 [inline]
 slab_free_freelist_hook+0x92/0x210 mm/slub.c:1600
 slab_free mm/slub.c:3161 [inline]
 kfree+0xe5/0x7f0 mm/slub.c:4213
 ip_mc_del1_src+0x674/0x7f0 net/ipv4/igmp.c:1884
 ip_mc_del_src.isra.0+0x3e1/0x950 net/ipv4/igmp.c:1925
 ip_mc_leave_src.isra.0+0x102/0x240 net/ipv4/igmp.c:2231
 ip_mc_drop_socket+0x11a/0x260 net/ipv4/igmp.c:2677
 inet_release+0x97/0x280 net/ipv4/af_inet.c:418
 __sock_release+0xcd/0x280 net/socket.c:599
 sock_close+0x18/0x20 net/socket.c:1258
 __fput+0x288/0x920 fs/file_table.c:280
 task_work_run+0xdd/0x1a0 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:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301
 __do_fast_syscall_32+0x62/0x90 arch/x86/entry/common.c:143
 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:165
 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c

The buggy address belongs to the object at ffff888022287b00
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 16 bytes inside of
 32-byte region [ffff888022287b00, ffff888022287b20)
The buggy address belongs to the page:
page:ffffea000088a1c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22287
flags: 0xfff00000000200(slab)
raw: 00fff00000000200 ffffea000062cd80 0000000800000008 ffff888010441500
raw: 0000000000000000 0000000000400040 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888022287a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
 ffff888022287a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
>ffff888022287b00: fa fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc
                         ^
 ffff888022287b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
 ffff888022287c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
==================================================================