================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007 Read of size 8 at addr ffff888032c2bc18 by task syz.1.1939/9335 CPU: 3 UID: 0 PID: 9335 Comm: syz.1.1939 Not tainted 6.11.0-rc7-syzkaller-00021-g7c6a3a65ace7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 __lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007 lock_acquire kernel/locking/lockdep.c:5759 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 p9_tag_remove net/9p/client.c:397 [inline] p9_req_put net/9p/client.c:405 [inline] p9_req_put+0xaf/0x250 net/9p/client.c:402 req_done+0x1e7/0x2f0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2595 [inline] vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2570 __handle_irq_event_percpu+0x229/0x7c0 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x263/0xd10 kernel/irq/chip.c:831 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:247 [inline] call_irq_handler arch/x86/kernel/irq.c:259 [inline] __common_interrupt+0xdf/0x250 arch/x86/kernel/irq.c:285 common_interrupt+0xab/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:unwind_next_frame+0xe6c/0x23a0 arch/x86/kernel/unwind_orc.c:641 Code: 0f 85 33 12 00 00 4c 89 f0 48 c7 43 58 00 00 00 00 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 0f b6 0c 10 49 8d 46 01 48 89 c6 <48> c1 ee 03 0f b6 14 16 4c 89 f6 83 e6 07 40 38 f1 40 0f 9e c6 84 RSP: 0018:ffffc9000626efa8 EFLAGS: 00000a03 RAX: ffffffff90b1914d RBX: ffffc9000626f028 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: ffffffff90b1914d RDI: ffffc9000626f080 RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: dffffc0000000000 R12: ffffffff90b19148 R13: ffffc9000626fc40 R14: ffffffff90b1914c R15: 0000000000000001 arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 save_stack+0x162/0x1f0 mm/page_owner.c:156 __set_page_owner+0x8b/0x560 mm/page_owner.c:320 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702 alloc_pages_mpol_noprof+0x275/0x610 mm/mempolicy.c:2263 get_free_pages_noprof+0xc/0x40 mm/page_alloc.c:4749 kasan_populate_vmalloc_pte+0x2d/0x160 mm/kasan/shadow.c:304 apply_to_pte_range mm/memory.c:2797 [inline] apply_to_pmd_range mm/memory.c:2841 [inline] apply_to_pud_range mm/memory.c:2877 [inline] apply_to_p4d_range mm/memory.c:2913 [inline] __apply_to_page_range+0x795/0xdd0 mm/memory.c:2947 alloc_vmap_area+0x93e/0x2a70 mm/vmalloc.c:2035 __get_vm_area_node+0x17e/0x2d0 mm/vmalloc.c:3122 __vmalloc_node_range_noprof+0x270/0x14e0 mm/vmalloc.c:3797 __vmalloc_node_noprof mm/vmalloc.c:3902 [inline] vzalloc_noprof+0x6b/0x90 mm/vmalloc.c:3975 profile_init+0xd5/0x130 kernel/profile.c:110 profiling_store+0x73/0xf0 kernel/ksysfs.c:111 kobj_attr_store+0x55/0x80 lib/kobject.c:840 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:136 kernfs_fop_write_iter+0x343/0x500 fs/kernfs/file.c:334 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fdca2d7def9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdca3aab038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fdca2f35f80 RCX: 00007fdca2d7def9 RDX: 0000000000000048 RSI: 0000000020000280 RDI: 0000000000000003 RBP: 00007fdca2df0b56 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fdca2f35f80 R15: 00007ffe0ad794f8 Allocated by task 9343: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_noprof include/linux/slab.h:681 [inline] p9_client_create+0xcf/0x1210 net/9p/client.c:983 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xa50 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1800 do_new_mount fs/namespace.c:3472 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3799 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount fs/namespace.c:3997 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 9343: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2256 [inline] slab_free mm/slub.c:4477 [inline] kfree+0x12a/0x3b0 mm/slub.c:4598 p9_client_create+0xaaa/0x1210 net/9p/client.c:1054 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xa50 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1800 do_new_mount fs/namespace.c:3472 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3799 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount fs/namespace.c:3997 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888032c2bc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888032c2bc00, ffff888032c2be00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x32c28 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff88801ac42c80 ffffea00004ad900 dead000000000002 raw: 0000000000000000 0000000080100010 00000001fdffffff 0000000000000000 head: 00fff00000000040 ffff88801ac42c80 ffffea00004ad900 dead000000000002 head: 0000000000000000 0000000080100010 00000001fdffffff 0000000000000000 head: 00fff00000000002 ffffea0000cb0a01 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5436, tgid 5436 (syz-executor), ts 74927111845, free_ts 74915285667 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x4e/0xf0 mm/slub.c:2325 allocate_slab mm/slub.c:2488 [inline] new_slab+0x84/0x260 mm/slub.c:2541 ___slab_alloc+0xdac/0x1870 mm/slub.c:3727 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3817 __slab_alloc_node mm/slub.c:3870 [inline] slab_alloc_node mm/slub.c:4029 [inline] __do_kmalloc_node mm/slub.c:4161 [inline] __kmalloc_noprof+0x367/0x400 mm/slub.c:4174 kmalloc_noprof include/linux/slab.h:685 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x337/0x1910 net/ipv6/route.c:3761 addrconf_f6i_alloc+0x393/0x670 net/ipv6/route.c:4588 fixup_permanent_addr net/ipv6/addrconf.c:3586 [inline] addrconf_permanent_addr net/ipv6/addrconf.c:3625 [inline] addrconf_notify+0x10ac/0x19d0 net/ipv6/addrconf.c:3697 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1994 call_netdevice_notifiers_extack net/core/dev.c:2032 [inline] call_netdevice_notifiers net/core/dev.c:2046 [inline] __dev_notify_flags+0x12d/0x2e0 net/core/dev.c:8877 dev_change_flags+0x10c/0x160 net/core/dev.c:8915 page last free pid 5436 tgid 5436 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3992 [inline] slab_alloc_node mm/slub.c:4041 [inline] __do_kmalloc_node mm/slub.c:4161 [inline] __kmalloc_noprof+0x199/0x400 mm/slub.c:4174 kmalloc_noprof include/linux/slab.h:685 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x337/0x1910 net/ipv6/route.c:3761 ip6_route_add+0x26/0x1c0 net/ipv6/route.c:3853 addrconf_prefix_route+0x2fe/0x510 net/ipv6/addrconf.c:2486 add_v4_addrs+0x6ce/0x9f0 net/ipv6/addrconf.c:3269 addrconf_gre_config net/ipv6/addrconf.c:3544 [inline] addrconf_init_auto_addrs+0x18a/0x820 net/ipv6/addrconf.c:3562 addrconf_notify+0xe9e/0x19d0 net/ipv6/addrconf.c:3743 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1994 call_netdevice_notifiers_extack net/core/dev.c:2032 [inline] call_netdevice_notifiers net/core/dev.c:2046 [inline] __dev_notify_flags+0x12d/0x2e0 net/core/dev.c:8877 dev_change_flags+0x10c/0x160 net/core/dev.c:8915 Memory state around the buggy address: ffff888032c2bb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888032c2bb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888032c2bc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888032c2bc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888032c2bd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 0f 85 33 12 00 00 jne 0x1239 6: 4c 89 f0 mov %r14,%rax 9: 48 c7 43 58 00 00 00 movq $0x0,0x58(%rbx) 10: 00 11: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 18: fc ff df 1b: 48 c1 e8 03 shr $0x3,%rax 1f: 0f b6 0c 10 movzbl (%rax,%rdx,1),%ecx 23: 49 8d 46 01 lea 0x1(%r14),%rax 27: 48 89 c6 mov %rax,%rsi * 2a: 48 c1 ee 03 shr $0x3,%rsi <-- trapping instruction 2e: 0f b6 14 16 movzbl (%rsi,%rdx,1),%edx 32: 4c 89 f6 mov %r14,%rsi 35: 83 e6 07 and $0x7,%esi 38: 40 38 f1 cmp %sil,%cl 3b: 40 0f 9e c6 setle %sil 3f: 84 .byte 0x84