================================================================== BUG: KASAN: use-after-free in ip_check_mc_rcu+0x5eb/0x670 net/ipv4/igmp.c:2717 Read of size 4 at addr ffff88802167fd18 by task syz-executor.1/13886 CPU: 1 PID: 13886 Comm: syz-executor.1 Not tainted 5.14.0-rc1-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+0x5eb/0x670 net/ipv4/igmp.c:2717 __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:1206 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:2392 ___sys_sendmsg+0xf3/0x170 net/socket.c:2446 __sys_sendmmsg+0x297/0x470 net/socket.c:2525 __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:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf7f1c549 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:00000000f55165fc EFLAGS: 00000296 ORIG_RAX: 0000000000000159 RAX: ffffffffffffffda RBX: 0000000000000005 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 13886: 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+0x9b/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:1972 [inline] ip_mc_add_src+0x78d/0xdc0 net/ipv4/igmp.c:2096 ip_mc_msfilter+0x81f/0xb50 net/ipv4/igmp.c:2480 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:2159 __do_sys_setsockopt net/socket.c:2170 [inline] __se_sys_setsockopt net/socket.c:2167 [inline] __ia32_sys_setsockopt+0xb9/0x150 net/socket.c:2167 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Freed by task 13880: 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+0xfb/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1625 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1650 slab_free mm/slub.c:3210 [inline] kfree+0xeb/0x650 mm/slub.c:4262 ip_mc_del1_src+0x67d/0x800 net/ipv4/igmp.c:1885 ip_mc_del_src.isra.0+0x37c/0x970 net/ipv4/igmp.c:1926 ip_mc_leave_src.isra.0+0xe9/0x250 net/ipv4/igmp.c:2232 ip_mc_drop_socket+0x11a/0x260 net/ipv4/igmp.c:2678 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:1300 __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_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c The buggy address belongs to the object at ffff88802167fd00 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 24 bytes inside of 32-byte region [ffff88802167fd00, ffff88802167fd20) The buggy address belongs to the page: page:ffffea0000859fc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802167f6c0 pfn:0x2167f flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00008ba400 0000000b0000000b ffff888010841500 raw: ffff88802167f6c0 0000000080400038 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 1, ts 9727666738, free_ts 0 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4166 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5388 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2119 alloc_pages+0x238/0x2a0 mm/mempolicy.c:2242 alloc_slab_page mm/slub.c:1688 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1828 new_slab mm/slub.c:1891 [inline] new_slab_objects mm/slub.c:2637 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2800 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2840 slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] __kmalloc+0x312/0x330 mm/slub.c:4100 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] kobject_get_path+0xbe/0x230 lib/kobject.c:179 kobject_uevent_env+0x265/0x1650 lib/kobject_uevent.c:529 driver_register+0x2db/0x3a0 drivers/base/driver.c:179 usb_register_driver+0x249/0x460 drivers/usb/core/driver.c:1061 usb_serial_register_drivers+0x211/0xc10 drivers/usb/serial/usb-serial.c:1511 do_one_initcall+0x103/0x650 init/main.c:1282 do_initcall_level init/main.c:1355 [inline] do_initcalls init/main.c:1371 [inline] do_basic_setup init/main.c:1391 [inline] kernel_init_freeable+0x6b8/0x741 init/main.c:1593 kernel_init+0x1a/0x1d0 init/main.c:1485 page_owner free stack trace missing Memory state around the buggy address: ffff88802167fc00: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88802167fc80: fb fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff88802167fd00: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff88802167fd80: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88802167fe00: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================