================================================================== BUG: KASAN: use-after-free in ip_check_mc_rcu+0x586/0x640 net/ipv4/igmp.c:2720 Read of size 8 at addr ffff8880282a3c10 by task syz-executor.2/11932 CPU: 0 PID: 11932 Comm: syz-executor.2 Not tainted 5.12.0-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+0x202/0x31e lib/dump_stack.c:120 print_address_description+0x5f/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x15c/0x200 mm/kasan/report.c:436 ip_check_mc_rcu+0x586/0x640 net/ipv4/igmp.c:2720 __mkroute_output net/ipv4/route.c:2405 [inline] ip_route_output_key_hash_rcu+0xf4f/0x25c0 net/ipv4/route.c:2684 ip_route_output_key_hash+0x1b7/0x300 net/ipv4/route.c:2512 __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x25/0x130 net/ipv4/route.c:2744 udp_sendmsg+0x1cec/0x3250 net/ipv4/udp.c:1206 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg net/socket.c:674 [inline] ____sys_sendmsg+0x5a2/0x900 net/socket.c:2350 ___sys_sendmsg net/socket.c:2404 [inline] __sys_sendmmsg+0x500/0x790 net/socket.c:2490 __do_sys_sendmmsg net/socket.c:2519 [inline] __se_sys_sendmmsg net/socket.c:2516 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2516 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 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:00007f55d2bd0188 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 00000000004665f9 RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000006 RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffd655d2cbf R14: 00007f55d2bd0300 R15: 0000000000022000 Allocated by task 11932: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc+0xc2/0xf0 mm/kasan/common.c:506 kasan_kmalloc include/linux/kasan.h:233 [inline] kmem_cache_alloc_trace+0x239/0x350 mm/slub.c:2934 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+0x786/0xda0 net/ipv4/igmp.c:2095 ip_mc_msfilter+0x6a1/0xc50 net/ipv4/igmp.c:2479 do_ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline] ip_setsockopt+0x3e78/0x5450 net/ipv4/ip_sockglue.c:1423 __sys_setsockopt+0x552/0x990 net/socket.c:2117 __do_sys_setsockopt net/socket.c:2128 [inline] __se_sys_setsockopt net/socket.c:2125 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2125 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 11926: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:357 ____kasan_slab_free+0x100/0x140 mm/kasan/common.c:360 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x171/0x270 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kfree+0xcf/0x2d0 mm/slub.c:4213 ip_mc_del1_src+0x6ff/0x860 net/ipv4/igmp.c:1884 ip_mc_del_src+0x656/0xa60 net/ipv4/igmp.c:1925 ip_mc_leave_src+0x10b/0x200 net/ipv4/igmp.c:2231 ip_mc_drop_socket+0x1c4/0x260 net/ipv4/igmp.c:2677 inet_release+0x82/0x1f0 net/ipv4/af_inet.c:418 __sock_release net/socket.c:599 [inline] sock_close+0xd8/0x260 net/socket.c:1258 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 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+0x10b/0x200 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x26/0x70 kernel/entry/common.c:301 do_syscall_64+0x4b/0xb0 arch/x86/entry/common.c:57 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880282a3c00 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 16 bytes inside of 32-byte region [ffff8880282a3c00, ffff8880282a3c20) The buggy address belongs to the page: page:ffffea0000a0a8c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x282a3 flags: 0xfff00000000200(slab) raw: 00fff00000000200 0000000000000000 0000001500000001 ffff888011441500 raw: 0000000000000000 0000000000400040 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880282a3b00: fa fb fb fb fc fc fc fc 00 00 01 fc fc fc fc fc ffff8880282a3b80: 00 00 00 00 fc fc fc fc 00 00 01 fc fc fc fc fc >ffff8880282a3c00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc ^ ffff8880282a3c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff8880282a3d00: 00 00 00 00 fc fc fc fc 00 00 01 fc fc fc fc fc ==================================================================