================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x4208/0x5de0 kernel/locking/lockdep.c:5012 Read of size 8 at addr ffff888052eb7418 by task syz-executor.2/12397 CPU: 1 PID: 12397 Comm: syz-executor.2 Not tainted 6.5.0-rc5-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __lock_acquire+0x4208/0x5de0 kernel/locking/lockdep.c:5012 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 p9_tag_remove net/9p/client.c:394 [inline] p9_req_put net/9p/client.c:402 [inline] p9_req_put+0xc6/0x250 net/9p/client.c:399 req_done+0x1e7/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2501 [inline] vring_interrupt+0x317/0x3f0 drivers/virtio/virtio_ring.c:2476 __handle_irq_event_percpu+0x22a/0x740 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+0x261/0xcf0 kernel/irq/chip.c:834 generic_handle_irq_desc include/linux/irqdesc.h:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0x9f/0x220 arch/x86/kernel/irq.c:257 common_interrupt+0xa9/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636 RIP: 0010:debug_lockdep_rcu_enabled+0x2f/0x30 kernel/rcu/update.c:321 Code: 05 ee ab 79 04 85 c0 74 21 8b 05 ec df 79 04 85 c0 74 17 65 48 8b 04 25 80 b9 03 00 8b 80 c4 0a 00 00 85 c0 0f 94 c0 0f b6 c0 66 0f 1f 00 55 53 65 8b 05 ef a4 d0 75 85 c0 40 0f 95 c5 65 8b RSP: 0018:ffffc9002a117618 EFLAGS: 00000246 RAX: 0000000000000001 RBX: ffff8880411b0b88 RCX: 0000000000000000 RDX: ffff888073efa400 RSI: ffffffff81e4a8e7 RDI: ffff8880411b0b88 RBP: 000000000005e028 R08: 0000000000000006 R09: 0000000000000001 R10: 0000000000000001 R11: 000000000000519a R12: 0000000000000008 R13: ffff88803fff9160 R14: 0000000000000002 R15: ffffea0001780a00 rcu_read_unlock include/linux/rcupdate.h:778 [inline] page_ext_put+0x1c/0xd0 mm/page_ext.c:192 page_table_check_clear include/linux/mmzone.h:2010 [inline] __page_table_check_pte_clear+0x24f/0x2a0 mm/page_table_check.c:161 page_table_check_pte_clear include/linux/page_table_check.h:55 [inline] ptep_get_and_clear_full arch/x86/include/asm/pgtable.h:1087 [inline] zap_pte_range mm/memory.c:1431 [inline] zap_pmd_range mm/memory.c:1570 [inline] zap_pud_range mm/memory.c:1599 [inline] zap_p4d_range mm/memory.c:1620 [inline] unmap_page_range+0x1dbf/0x32e0 mm/memory.c:1641 unmap_single_vma+0x194/0x2b0 mm/memory.c:1687 unmap_vmas+0x267/0x3c0 mm/memory.c:1726 exit_mmap+0x1a7/0x960 mm/mmap.c:3203 __mmput+0x12a/0x4d0 kernel/fork.c:1348 mmput+0x62/0x70 kernel/fork.c:1370 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b4/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23ea/0x2770 kernel/signal.c:2881 arch_do_signal_or_restart+0x89/0x5f0 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 __do_fast_syscall_32+0x6d/0xe0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f71579 Code: Unable to access opcode bytes at 0xf7f7154f. RSP: 002b:00000000f7f6c66c EFLAGS: 00000246 ORIG_RAX: 00000000000000f0 RAX: 0000000000000001 RBX: 00000000f737afcc RCX: 0000000000000081 RDX: 00000000000f4240 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00000000f7219d69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 12398: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:582 [inline] p9_client_create+0xcf/0x1210 net/9p/client.c:978 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xcd0 fs/9p/vfs_super.c:123 legacy_get_tree+0x109/0x220 fs/fs_context.c:611 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3861 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Freed by task 12398: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15e/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3814 p9_client_create+0xa14/0x1210 net/9p/client.c:1049 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xcd0 fs/9p/vfs_super.c:123 legacy_get_tree+0x109/0x220 fs/fs_context.c:611 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3861 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x4a/0x330 kernel/workqueue.c:1553 __queue_work+0x5f5/0x1040 kernel/workqueue.c:1714 call_timer_fn+0x1a0/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x585/0xb10 kernel/time/timer.c:2022 run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035 __do_softirq+0x218/0x965 kernel/softirq.c:553 The buggy address belongs to the object at ffff888052eb7400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888052eb7400, ffff888052eb7600) The buggy address belongs to the physical page: page:ffffea00014bad00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x52eb4 head:ffffea00014bad00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x4fff00000010200(slab|head|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000010200 ffff888012842c80 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 10, tgid 10 (kworker/u17:0), ts 100966389141, free_ts 98418430446 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 __alloc_pages_node include/linux/gfp.h:237 [inline] alloc_slab_page mm/slub.c:1864 [inline] allocate_slab+0xa1/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3509 kmalloc_node_trace+0x22/0xd0 mm/slab_common.c:1089 kmalloc_node include/linux/slab.h:598 [inline] new_vmap_block mm/vmalloc.c:2034 [inline] vb_alloc mm/vmalloc.c:2212 [inline] vm_map_ram+0x6d7/0xd90 mm/vmalloc.c:2389 _xfs_buf_map_pages+0x158/0x3a0 fs/xfs/xfs_buf.c:440 xfs_buf_get_map+0x1d5c/0x31c0 fs/xfs/xfs_buf.c:718 xfs_buf_read_map+0xd0/0xad0 fs/xfs/xfs_buf.c:810 xfs_buf_readahead_map+0x9a/0xd0 fs/xfs/xfs_buf.c:888 xfs_buf_readahead fs/xfs/xfs_buf.h:262 [inline] xfs_btree_reada_bufs+0x180/0x1f0 fs/xfs/libxfs/xfs_btree.c:926 xfs_iwalk_ichunk_ra+0x2df/0x440 fs/xfs/xfs_iwalk.c:114 xfs_iwalk_ag+0x62e/0x9b0 fs/xfs/xfs_iwalk.c:455 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 kasan_depopulate_vmalloc_pte+0x63/0x80 mm/kasan/shadow.c:427 apply_to_pte_range mm/memory.c:2596 [inline] apply_to_pmd_range mm/memory.c:2640 [inline] apply_to_pud_range mm/memory.c:2676 [inline] apply_to_p4d_range mm/memory.c:2712 [inline] __apply_to_page_range+0x5ed/0xd40 mm/memory.c:2746 kasan_release_vmalloc+0xa8/0xc0 mm/kasan/shadow.c:544 __purge_vmap_area_lazy+0x8b9/0x2160 mm/vmalloc.c:1770 drain_vmap_area_work+0x54/0xd0 mm/vmalloc.c:1804 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888052eb7300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888052eb7380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888052eb7400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888052eb7480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888052eb7500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 05 ee ab 79 04 add $0x479abee,%eax 5: 85 c0 test %eax,%eax 7: 74 21 je 0x2a 9: 8b 05 ec df 79 04 mov 0x479dfec(%rip),%eax # 0x479dffb f: 85 c0 test %eax,%eax 11: 74 17 je 0x2a 13: 65 48 8b 04 25 80 b9 mov %gs:0x3b980,%rax 1a: 03 00 1c: 8b 80 c4 0a 00 00 mov 0xac4(%rax),%eax 22: 85 c0 test %eax,%eax 24: 0f 94 c0 sete %al 27: 0f b6 c0 movzbl %al,%eax * 2a: c3 ret <-- trapping instruction 2b: 66 0f 1f 00 nopw (%rax) 2f: 55 push %rbp 30: 53 push %rbx 31: 65 8b 05 ef a4 d0 75 mov %gs:0x75d0a4ef(%rip),%eax # 0x75d0a527 38: 85 c0 test %eax,%eax 3a: 40 0f 95 c5 setne %bpl 3e: 65 gs 3f: 8b .byte 0x8b