================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007 Read of size 8 at addr ffff8880286dbc18 by task udevd/4833 CPU: 0 UID: 0 PID: 4833 Comm: udevd Not tainted 6.11.0-rc5-syzkaller-00081-gd5d547aa7b51 #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:strcmp+0x68/0xb0 lib/string.c:267 Code: 38 d0 7f 04 84 c0 75 58 0f b6 6b ff 4c 8d 66 01 48 89 f0 48 89 f2 48 c1 e8 03 83 e2 07 42 0f b6 04 28 38 d0 7f 04 84 c0 75 2c <41> 3a 6c 24 ff 74 ae 19 c0 48 83 c4 08 5b 83 c8 01 5d 41 5c 41 5d RSP: 0018:ffffc90004b9f930 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff888012bdbc59 RCX: ffffffff82244f04 RDX: 0000000000000000 RSI: ffffffff8bdb1e40 RDI: ffff888012bdbc58 RBP: 0000000000000064 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8bdb1e41 R13: dffffc0000000000 R14: ffff888016e900d8 R15: ffff88802b89552d kernfs_dop_revalidate+0x22f/0x5a0 fs/kernfs/dir.c:1170 d_revalidate fs/namei.c:868 [inline] d_revalidate fs/namei.c:865 [inline] lookup_fast+0x239/0x540 fs/namei.c:1679 walk_component+0x5b/0x5b0 fs/namei.c:2035 link_path_walk.part.0.constprop.0+0x669/0xd40 fs/namei.c:2404 link_path_walk fs/namei.c:2335 [inline] path_lookupat+0x93/0x770 fs/namei.c:2565 filename_lookup+0x1e5/0x5b0 fs/namei.c:2595 vfs_statx+0x11e/0x1e0 fs/stat.c:312 vfs_fstatat+0x9f/0x160 fs/stat.c:341 __do_sys_newfstatat+0xa2/0x130 fs/stat.c:505 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:0x7fe3cb3165f4 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:00007ffd57b04e58 EFLAGS: 00000246 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe3cb3165f4 RDX: 00007ffd57b04e68 RSI: 00007ffd57b052f8 RDI: 00000000ffffff9c RBP: 00007ffd57b04ef8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd57b052f8 R13: 00007ffd57b04e68 R14: 000055f2121fb910 R15: 0000000000000000 Allocated by task 5563: 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/0x11b0 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+0x6e1/0x1f10 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] __ia32_sys_mount+0x292/0x310 fs/namespace.c:3997 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 5563: 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:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x12a/0x3b0 mm/slub.c:4594 p9_client_create+0x9ca/0x11b0 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+0x6e1/0x1f10 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] __ia32_sys_mount+0x292/0x310 fs/namespace.c:3997 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff8880286dbc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff8880286dbc00, ffff8880286dbe00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x286d8 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 ffff888015842c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080100010 00000001fdffffff 0000000000000000 head: 00fff00000000040 ffff888015842c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000080100010 00000001fdffffff 0000000000000000 head: 00fff00000000002 ffffea0000a1b601 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5389, tgid 5389 (syz-executor), ts 61701861558, free_ts 61558648849 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3439 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4695 __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:2321 allocate_slab mm/slub.c:2484 [inline] new_slab+0x84/0x260 mm/slub.c:2537 ___slab_alloc+0xdac/0x1870 mm/slub.c:3723 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __do_kmalloc_node mm/slub.c:4157 [inline] __kmalloc_noprof+0x379/0x410 mm/slub.c:4170 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/0x1aa0 net/ipv6/route.c:3761 addrconf_f6i_alloc+0x393/0x670 net/ipv6/route.c:4588 ipv6_add_addr+0x538/0x2060 net/ipv6/addrconf.c:1120 inet6_addr_add+0x3bb/0xbc0 net/ipv6/addrconf.c:3060 inet6_rtm_newaddr+0x11d4/0x1aa0 net/ipv6/addrconf.c:5048 rtnetlink_rcv_msg+0x3c7/0xea0 net/core/rtnetlink.c:6647 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2550 page last free pid 5433 tgid 5433 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612 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:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4044 getname_flags.part.0+0x4c/0x550 fs/namei.c:139 getname_flags include/linux/audit.h:322 [inline] getname+0x8d/0xe0 fs/namei.c:225 do_sys_openat2+0x104/0x1e0 fs/open.c:1410 do_sys_open fs/open.c:1431 [inline] __do_sys_openat fs/open.c:1447 [inline] __se_sys_openat fs/open.c:1442 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1442 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: ffff8880286dbb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880286dbb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880286dbc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880286dbc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880286dbd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 38 d0 cmp %dl,%al 2: 7f 04 jg 0x8 4: 84 c0 test %al,%al 6: 75 58 jne 0x60 8: 0f b6 6b ff movzbl -0x1(%rbx),%ebp c: 4c 8d 66 01 lea 0x1(%rsi),%r12 10: 48 89 f0 mov %rsi,%rax 13: 48 89 f2 mov %rsi,%rdx 16: 48 c1 e8 03 shr $0x3,%rax 1a: 83 e2 07 and $0x7,%edx 1d: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax 22: 38 d0 cmp %dl,%al 24: 7f 04 jg 0x2a 26: 84 c0 test %al,%al 28: 75 2c jne 0x56 * 2a: 41 3a 6c 24 ff cmp -0x1(%r12),%bpl <-- trapping instruction 2f: 74 ae je 0xffffffdf 31: 19 c0 sbb %eax,%eax 33: 48 83 c4 08 add $0x8,%rsp 37: 5b pop %rbx 38: 83 c8 01 or $0x1,%eax 3b: 5d pop %rbp 3c: 41 5c pop %r12 3e: 41 5d pop %r13