================================================================== BUG: KASAN: use-after-free in __rb_insert lib/rbtree.c:115 [inline] BUG: KASAN: use-after-free in __rb_insert_augmented+0xa0/0x610 lib/rbtree.c:459 Read of size 8 at addr ffff8881c0000008 by task syz-executor.0/2226 CPU: 1 PID: 2226 Comm: syz-executor.0 Tainted: G W 5.15.148-syzkaller-00718-g993bed180178 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309 __rb_insert lib/rbtree.c:115 [inline] __rb_insert_augmented+0xa0/0x610 lib/rbtree.c:459 rb_insert_augmented include/linux/rbtree_augmented.h:50 [inline] vma_interval_tree_insert_after+0x2be/0x2d0 mm/interval_tree.c:57 dup_mmap kernel/fork.c:631 [inline] dup_mm kernel/fork.c:1521 [inline] copy_mm+0xba2/0x13e0 kernel/fork.c:1573 copy_process+0x1149/0x3290 kernel/fork.c:2264 kernel_clone+0x21e/0x9e0 kernel/fork.c:2662 __do_sys_clone kernel/fork.c:2788 [inline] __se_sys_clone kernel/fork.c:2772 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2772 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fd6e43c6dd3 Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00 RSP: 002b:00007ffcc6ac3aa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fd6e43c6dd3 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000555556135750 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001 The buggy address belongs to the page: page:ffffea0007000000 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x2 pfn:0x1c0000 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0006e90008 ffffea0006d90008 0000000000000000 raw: 0000000000000002 0000000000000009 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0x140dc0(GFP_USER|__GFP_COMP|__GFP_ZERO), pid 15138, ts 350115824039, free_ts 363543410955 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2604 prep_new_page+0x1b/0x110 mm/page_alloc.c:2610 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4484 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5776 __alloc_pages_node include/linux/gfp.h:591 [inline] alloc_pages_node include/linux/gfp.h:605 [inline] alloc_pages include/linux/gfp.h:618 [inline] kmalloc_order+0x4a/0x160 mm/slab_common.c:975 kmalloc_order_trace+0x1a/0xb0 mm/slab_common.c:994 kmalloc_large include/linux/slab.h:532 [inline] kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:733 [inline] tipc_nametbl_init+0x98/0x260 net/tipc/name_table.c:891 tipc_init_net+0x27c/0x370 net/tipc/core.c:80 ops_init+0x1cf/0x4a0 net/core/net_namespace.c:135 setup_net+0x34b/0xb50 net/core/net_namespace.c:329 copy_net_ns+0x35c/0x5b0 net/core/net_namespace.c:473 create_new_namespaces+0x416/0x670 kernel/nsproxy.c:110 copy_namespaces+0x1d1/0x220 kernel/nsproxy.c:178 copy_process+0x1174/0x3290 kernel/fork.c:2267 kernel_clone+0x21e/0x9e0 kernel/fork.c:2662 __do_sys_clone kernel/fork.c:2788 [inline] __se_sys_clone kernel/fork.c:2772 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2772 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1471 [inline] free_pcp_prepare mm/page_alloc.c:1543 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3533 free_unref_page+0xe8/0x750 mm/page_alloc.c:3615 free_the_page mm/page_alloc.c:804 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5852 free_nonslab_page+0x82/0xc0 mm/slub.c:3555 kfree+0x19e/0x220 mm/slub.c:4576 tipc_nametbl_stop+0x1249/0x12b0 net/tipc/name_table.c:953 tipc_exit_net+0x99/0x190 net/tipc/core.c:116 ops_exit_list net/core/net_namespace.c:169 [inline] cleanup_net+0x64b/0xc00 net/core/net_namespace.c:596 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Memory state around the buggy address: ffff8881bfffff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881bfffff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881c0000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881c0000080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881c0000100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================