================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4925 Read of size 8 at addr ffff888012050018 by task udevd/7686 CPU: 1 PID: 7686 Comm: udevd Not tainted 6.2.0-rc2-syzkaller-00282-g0a71553536d2 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517 __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4925 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162 p9_tag_remove net/9p/client.c:390 [inline] p9_req_put net/9p/client.c:398 [inline] p9_req_put+0xca/0x250 net/9p/client.c:395 req_done+0x1e2/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2470 [inline] vring_interrupt+0x2a1/0x3d0 drivers/virtio/virtio_ring.c:2445 __handle_irq_event_percpu+0x264/0x970 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/0xd00 kernel/irq/chip.c:819 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:231 [inline] __common_interrupt+0xa1/0x210 arch/x86/kernel/irq.c:250 common_interrupt+0xa8/0xd0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:640 RIP: 0010:kasan_check_range+0x0/0x190 mm/kasan/generic.c:188 Code: 74 17 8b 43 08 40 0f b6 f5 bf 00 08 00 00 89 43 0c e8 64 e4 ff ff 89 43 08 5b 5d 41 5c c3 66 66 2e 0f 1f 84 00 00 00 00 00 90 <66> 0f 1f 00 48 85 f6 0f 84 3c 01 00 00 49 89 f9 41 54 44 0f b6 c2 RSP: 0018:ffffc90003f4f798 EFLAGS: 00000282 RAX: 0000000000000001 RBX: 1ffff920007e9ef5 RCX: ffffffff816458d5 RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff8880128a67e8 RBP: ffff8880128a67e8 R08: 0000000000000000 R09: ffffffff91336acf R10: fffffbfff2266d59 R11: 0000000000000000 R12: ffff8880128a67f0 R13: ffff8880128a67f8 R14: 00000000ffffffff R15: ffff888023260a20 instrument_atomic_read_write include/linux/instrumented.h:102 [inline] atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] do_raw_spin_lock+0x115/0x2b0 kernel/locking/spinlock_debug.c:115 spin_lock include/linux/spinlock.h:350 [inline] fast_dput fs/dcache.c:789 [inline] fast_dput fs/dcache.c:765 [inline] dput+0x494/0xdb0 fs/dcache.c:900 step_into+0xf63/0x20c0 fs/namei.c:1846 walk_component+0xf5/0x5a0 fs/namei.c:1999 link_path_walk.part.0+0x730/0xdf0 fs/namei.c:2320 link_path_walk fs/namei.c:2244 [inline] path_lookupat+0xb7/0x840 fs/namei.c:2473 filename_lookup+0x1d2/0x590 fs/namei.c:2503 vfs_statx+0x14c/0x430 fs/stat.c:232 vfs_fstatat+0x90/0xb0 fs/stat.c:270 __do_sys_newfstatat+0x94/0x120 fs/stat.c:440 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe7c87251da Code: 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 0b 00 00 00 66 2e 0f 1f 84 00 00 00 00 00 90 41 89 ca b8 06 01 00 00 0f 05 <3d> 00 f0 ff ff 77 07 31 c0 c3 0f 1f 40 00 48 8b 15 69 fc 0c 00 f7 RSP: 002b:00007ffee338fa38 EFLAGS: 00000246 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 000055569e44bdd0 RCX: 00007fe7c87251da RDX: 00007ffee338fa48 RSI: 00007ffee338fed8 RDI: 00000000ffffff9c RBP: 00007ffee338fad8 R08: 0000000000000000 R09: 00007fe7c87f5a60 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffee338fed8 R13: 00007ffee338fa48 R14: 000055569e425910 R15: 000055569cbaaa7c Allocated by task 10881: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:580 [inline] p9_client_create+0xb3/0x1070 net/9p/client.c:975 v9fs_session_init+0x1e6/0x18b0 fs/9p/v9fs.c:407 v9fs_mount+0xbe/0xca0 fs/9p/vfs_super.c:125 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x2f0 fs/super.c:1489 do_new_mount fs/namespace.c:3145 [inline] path_mount+0x132a/0x1e20 fs/namespace.c:3475 do_mount fs/namespace.c:3488 [inline] __do_sys_mount fs/namespace.c:3697 [inline] __se_sys_mount fs/namespace.c:3674 [inline] __ia32_sys_mount+0x282/0x300 fs/namespace.c:3674 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 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 10881: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:518 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0xaf/0x3b0 mm/slub.c:3800 p9_client_create+0x7aa/0x1070 net/9p/client.c:1046 v9fs_session_init+0x1e6/0x18b0 fs/9p/v9fs.c:407 v9fs_mount+0xbe/0xca0 fs/9p/vfs_super.c:125 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x2f0 fs/super.c:1489 do_new_mount fs/namespace.c:3145 [inline] path_mount+0x132a/0x1e20 fs/namespace.c:3475 do_mount fs/namespace.c:3488 [inline] __do_sys_mount fs/namespace.c:3697 [inline] __se_sys_mount fs/namespace.c:3674 [inline] __ia32_sys_mount+0x282/0x300 fs/namespace.c:3674 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 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 The buggy address belongs to the object at ffff888012050000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of 512-byte region [ffff888012050000, ffff888012050200) The buggy address belongs to the physical page: page:ffffea0000481400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12050 head:ffffea0000481400 order:2 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012442c80 dead000000000100 dead000000000122 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 12, tgid 12 (kworker/u16:1), ts 359673405836, free_ts 358105740191 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2286 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x350 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x1a4/0x430 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc_node_track_caller+0x4b/0xc0 mm/slab_common.c:988 kmalloc_reserve net/core/skbuff.c:492 [inline] __alloc_skb+0xe9/0x310 net/core/skbuff.c:565 alloc_skb include/linux/skbuff.h:1270 [inline] nlmsg_new include/net/netlink.h:1002 [inline] inet_netconf_notify_devconf+0xe1/0x260 net/ipv4/devinet.c:2102 __devinet_sysctl_unregister net/ipv4/devinet.c:2614 [inline] devinet_exit_net+0x1ae/0x280 net/ipv4/devinet.c:2755 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:169 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3464 kasan_depopulate_vmalloc_pte+0x60/0x80 mm/kasan/shadow.c:372 apply_to_pte_range mm/memory.c:2600 [inline] apply_to_pmd_range mm/memory.c:2644 [inline] apply_to_pud_range mm/memory.c:2680 [inline] apply_to_p4d_range mm/memory.c:2716 [inline] __apply_to_page_range+0x68c/0x1030 mm/memory.c:2750 kasan_release_vmalloc+0xab/0xc0 mm/kasan/shadow.c:486 __purge_vmap_area_lazy+0x897/0x1f80 mm/vmalloc.c:1776 drain_vmap_area_work+0x56/0xe0 mm/vmalloc.c:1809 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff88801204ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88801204ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888012050000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888012050080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888012050100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 74 17 je 0x19 2: 8b 43 08 mov 0x8(%rbx),%eax 5: 40 0f b6 f5 movzbl %bpl,%esi 9: bf 00 08 00 00 mov $0x800,%edi e: 89 43 0c mov %eax,0xc(%rbx) 11: e8 64 e4 ff ff callq 0xffffe47a 16: 89 43 08 mov %eax,0x8(%rbx) 19: 5b pop %rbx 1a: 5d pop %rbp 1b: 41 5c pop %r12 1d: c3 retq 1e: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1) 25: 00 00 00 00 29: 90 nop * 2a: 66 0f 1f 00 nopw (%rax) <-- trapping instruction 2e: 48 85 f6 test %rsi,%rsi 31: 0f 84 3c 01 00 00 je 0x173 37: 49 89 f9 mov %rdi,%r9 3a: 41 54 push %r12 3c: 44 0f b6 c2 movzbl %dl,%r8d