================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2d90/0x3c40 kernel/locking/lockdep.c:5089 Read of size 8 at addr ffff888023c8ec18 by task syz.3.461/7738 CPU: 3 UID: 0 PID: 7738 Comm: syz.3.461 Not tainted 6.13.0-rc2-syzkaller-00036-g231825b2e1ff #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:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 __lock_acquire+0x2d90/0x3c40 kernel/locking/lockdep.c:5089 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __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:2715 [inline] vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2690 __handle_irq_event_percpu+0x229/0x7d0 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+0xba/0xe0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:trace_lock_acquire+0x6/0x1f0 include/trace/events/lock.h:24 Code: 31 d2 4c 89 cf e8 6a c1 18 00 48 89 c6 eb aa e8 40 05 b3 09 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 41 56 41 55 55 53 <48> 83 ec 18 66 90 49 c7 c5 0c d9 03 00 65 41 8b 5d 00 83 fb 07 0f RSP: 0018:ffffc900039f74f8 EFLAGS: 00000296 RAX: ffffffff820853e4 RBX: ffffffff820853e4 RCX: 0000000000000002 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff8e1bb500 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000003 R12: 0000000000000000 R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000000 lock_acquire+0x2f/0xb0 kernel/locking/lockdep.c:5820 rcu_lock_acquire include/linux/rcupdate.h:337 [inline] rcu_read_lock include/linux/rcupdate.h:849 [inline] page_ext_get+0x3a/0x310 mm/page_ext.c:525 page_table_check_clear.part.0+0x32/0x540 mm/page_table_check.c:74 page_table_check_clear mm/page_table_check.c:70 [inline] __page_table_check_pte_clear+0x328/0x580 mm/page_table_check.c:169 page_table_check_pte_clear include/linux/page_table_check.h:49 [inline] ptep_get_and_clear_full arch/x86/include/asm/pgtable.h:1337 [inline] get_and_clear_full_ptes include/linux/pgtable.h:705 [inline] zap_present_folio_ptes mm/memory.c:1502 [inline] zap_present_ptes mm/memory.c:1585 [inline] zap_pte_range mm/memory.c:1627 [inline] zap_pmd_range mm/memory.c:1753 [inline] zap_pud_range mm/memory.c:1782 [inline] zap_p4d_range mm/memory.c:1803 [inline] unmap_page_range+0x22f6/0x3d60 mm/memory.c:1824 unmap_single_vma+0x194/0x2b0 mm/memory.c:1870 unmap_vmas+0x22f/0x490 mm/memory.c:1914 exit_mmap+0x1c6/0xb20 mm/mmap.c:1668 __mmput+0x12a/0x4c0 kernel/fork.c:1353 mmput+0x62/0x70 kernel/fork.c:1375 exit_mm kernel/exit.c:570 [inline] do_exit+0x9bf/0x2d70 kernel/exit.c:925 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 get_signal+0x24ed/0x26c0 kernel/signal.c:3017 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f11fc385d19 Code: Unable to access opcode bytes at 0x7f11fc385cef. RSP: 002b:00007f11fd26b0e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000000 RBX: 00007f11fc576088 RCX: 00007f11fc385d19 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f11fc576088 RBP: 00007f11fc576080 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f11fc57608c R13: 0000000000000000 R14: 00007fff6ba08730 R15: 00007fff6ba08818 Allocated by task 7745: 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:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:901 [inline] p9_client_create+0xc8/0x1200 net/9p/client.c:985 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xa30 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 7745: 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:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2338 [inline] slab_free mm/slub.c:4598 [inline] kfree+0x14f/0x4b0 mm/slub.c:4746 p9_client_create+0xa58/0x1200 net/9p/client.c:1064 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xa30 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 ffff888023c8ec00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888023c8ec00, ffff888023c8ee00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x23c8c 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: f5(slab) raw: 00fff00000000040 ffff88801b042c80 ffffea00008f6b00 dead000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801b042c80 ffffea00008f6b00 dead000000000002 head: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000 head: 00fff00000000002 ffffea00008f2301 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 374, tgid 374 (kworker/u32:6), ts 108156101417, free_ts 108104768327 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2408 [inline] allocate_slab mm/slub.c:2574 [inline] new_slab+0x2c9/0x410 mm/slub.c:2627 ___slab_alloc+0xdac/0x1870 mm/slub.c:3815 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3905 __slab_alloc_node mm/slub.c:3980 [inline] slab_alloc_node mm/slub.c:4141 [inline] __do_kmalloc_node mm/slub.c:4282 [inline] __kmalloc_noprof+0x2ec/0x510 mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [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 addrconf_add_linklocal+0x32a/0x620 net/ipv6/addrconf.c:3338 addrconf_addr_gen+0x36f/0x3c0 net/ipv6/addrconf.c:3467 addrconf_dev_config net/ipv6/addrconf.c:3513 [inline] addrconf_init_auto_addrs+0x446/0x820 net/ipv6/addrconf.c:3591 addrconf_notify+0x6e2/0x19c0 net/ipv6/addrconf.c:3764 page last free pid 6006 tgid 6006 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2657 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4104 [inline] slab_alloc_node mm/slub.c:4153 [inline] kmem_cache_alloc_noprof+0x226/0x3d0 mm/slub.c:4160 getname_flags.part.0+0x4c/0x550 fs/namei.c:139 getname_flags include/linux/audit.h:322 [inline] getname+0x8d/0xe0 fs/namei.c:223 getname_maybe_null include/linux/fs.h:2796 [inline] vfs_fstatat+0xdf/0xf0 fs/stat.c:361 __do_sys_newfstatat+0xa2/0x130 fs/stat.c:530 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 Memory state around the buggy address: ffff888023c8eb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888023c8eb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888023c8ec00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888023c8ec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888023c8ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 31 d2 xor %edx,%edx 2: 4c 89 cf mov %r9,%rdi 5: e8 6a c1 18 00 call 0x18c174 a: 48 89 c6 mov %rax,%rsi d: eb aa jmp 0xffffffb9 f: e8 40 05 b3 09 call 0x9b30554 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 90 nop 1f: 90 nop 20: 90 nop 21: 90 nop 22: 90 nop 23: 90 nop 24: 41 56 push %r14 26: 41 55 push %r13 28: 55 push %rbp 29: 53 push %rbx * 2a: 48 83 ec 18 sub $0x18,%rsp <-- trapping instruction 2e: 66 90 xchg %ax,%ax 30: 49 c7 c5 0c d9 03 00 mov $0x3d90c,%r13 37: 65 41 8b 5d 00 mov %gs:0x0(%r13),%ebx 3c: 83 fb 07 cmp $0x7,%ebx 3f: 0f .byte 0xf