================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff88805e21cc18 by task udevd/5435 CPU: 0 PID: 5435 Comm: udevd Not tainted 6.9.0-rc1-syzkaller-00355-g712e14250dd2 #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+0x116/0x1f0 lib/dump_stack.c:114 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+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __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:394 [inline] p9_req_put net/9p/client.c:402 [inline] p9_req_put+0xca/0x250 net/9p/client.c:399 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:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0xde/0x250 arch/x86/kernel/irq.c:257 common_interrupt+0xab/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:preempt_count arch/x86/include/asm/preempt.h:26 [inline] RIP: 0010:check_kcov_mode kernel/kcov.c:173 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0xc/0x60 kernel/kcov.c:207 Code: c3 cc cc cc cc 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 65 48 8b 15 04 c2 75 7e <65> 8b 05 05 c2 75 7e a9 00 01 ff 00 48 8b 34 24 74 0f f6 c4 01 74 RSP: 0018:ffffc9000766f8e8 EFLAGS: 00000202 RAX: 0000000000000000 RBX: ffffc9000766f970 RCX: ffffc9000766f9a4 RDX: ffff88801c14a440 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff9039f626 R13: ffffc9000766fd98 R14: ffffffff9039f62a R15: 0000000000000001 deref_stack_reg arch/x86/kernel/unwind_orc.c:406 [inline] unwind_next_frame+0xdb9/0x23a0 arch/x86/kernel/unwind_orc.c:585 arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 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 mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x12e/0x380 mm/slub.c:4344 putname+0x12e/0x170 fs/namei.c:273 vfs_fstatat+0xbd/0x150 fs/stat.c:305 __do_sys_newfstatat+0x98/0x120 fs/stat.c:468 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x72/0x7a RIP: 0033:0x7f79f63165f4 Code: 64 c7 00 09 00 00 00 83 c8 ff c3 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 00 00 00 00 41 89 ca b8 06 01 00 00 0f 05 <45> 31 c0 3d 00 f0 ff ff 76 10 48 8b 15 03 a8 0d 00 f7 d8 41 83 c8 RSP: 002b:00007ffc593b8208 EFLAGS: 00000246 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 0000562497ec5240 RCX: 00007f79f63165f4 RDX: 00007ffc593b8268 RSI: 00007ffc593b86f8 RDI: 00000000ffffff9c RBP: 0000562497eb514c R08: fec0c80000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000562497ec8fa0 R13: 00007ffc593b86f8 R14: 0000562497eb3820 R15: 0000562475c1da04 Allocated by task 5690: 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 include/linux/slab.h:628 [inline] p9_client_create+0xcf/0x11b0 net/9p/client.c:980 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1797 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e1/0x1f10 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __ia32_sys_mount+0x295/0x320 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7f/0x89 Freed by task 5690: 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 mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x129/0x390 mm/slub.c:4390 p9_client_create+0x9ca/0x11b0 net/9p/client.c:1051 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1797 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e1/0x1f10 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __ia32_sys_mount+0x295/0x320 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7f/0x89 The buggy address belongs to the object at ffff88805e21cc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88805e21cc00, ffff88805e21ce00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5e21c head: order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff80000000840(slab|head|node=1|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 04fff80000000840 ffff888014c42c80 ffffea0000451e00 dead000000000002 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 head: 04fff80000000840 ffff888014c42c80 ffffea0000451e00 dead000000000002 head: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 head: 04fff80000000002 ffffea0001788701 dead000000000122 00000000ffffffff head: 0000000400000000 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5286, tgid 5286 (syz-executor.1), ts 58110091096, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x670/0x16d0 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc_node+0x36e/0x480 mm/slub.c:3973 kmalloc_array_node include/linux/slab.h:726 [inline] kcalloc_node include/linux/slab.h:731 [inline] memcg_alloc_slab_cgroups+0xa9/0x180 mm/memcontrol.c:3015 __memcg_slab_post_alloc_hook+0xa3/0x370 mm/slub.c:1960 memcg_slab_post_alloc_hook mm/slub.c:1983 [inline] slab_post_alloc_hook mm/slub.c:3807 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc+0x310/0x320 mm/slub.c:3852 anon_vma_chain_alloc mm/rmap.c:142 [inline] __anon_vma_prepare+0x64/0x550 mm/rmap.c:196 anon_vma_prepare include/linux/rmap.h:164 [inline] do_anonymous_page mm/memory.c:4430 [inline] do_pte_missing mm/memory.c:3878 [inline] handle_pte_fault mm/memory.c:5300 [inline] __handle_mm_fault+0x3c82/0x4a80 mm/memory.c:5441 handle_mm_fault+0x476/0xa00 mm/memory.c:5606 do_user_addr_fault+0x2e5/0x1080 arch/x86/mm/fault.c:1413 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page_owner free stack trace missing Memory state around the buggy address: ffff88805e21cb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805e21cb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805e21cc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805e21cc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805e21cd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: c3 ret 1: cc int3 2: cc int3 3: cc int3 4: cc int3 5: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) c: 00 00 e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 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: f3 0f 1e fa endbr64 22: 65 48 8b 15 04 c2 75 mov %gs:0x7e75c204(%rip),%rdx # 0x7e75c22e 29: 7e * 2a: 65 8b 05 05 c2 75 7e mov %gs:0x7e75c205(%rip),%eax # 0x7e75c236 <-- trapping instruction 31: a9 00 01 ff 00 test $0xff0100,%eax 36: 48 8b 34 24 mov (%rsp),%rsi 3a: 74 0f je 0x4b 3c: f6 c4 01 test $0x1,%ah 3f: 74 .byte 0x74