================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2da1/0x3b40 kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff8880276d7018 by task rm/9381 CPU: 0 PID: 9381 Comm: rm Not tainted 6.8.0-rc6-syzkaller-00011-g45ec2f5f6ed3 #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:377 [inline] print_report+0xc4/0x620 mm/kasan/report.c:488 kasan_report+0xda/0x110 mm/kasan/report.c:601 __lock_acquire+0x2da1/0x3b40 kernel/locking/lockdep.c:5005 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 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+0x22a/0x750 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:640 RIP: 0010:link_path_walk.part.0.constprop.0+0x4db/0xcd0 fs/namei.c:2294 Code: 67 3c fb 48 c1 e8 03 0f b6 04 38 84 c0 74 08 3c 03 0f 8e f6 07 00 00 48 8b 04 24 31 ff 8b 00 89 c5 89 44 24 18 83 e5 01 89 ee 20 1a 91 ff 85 ed 0f 85 fc 03 00 00 e8 33 1f 91 ff 48 89 dd 45 RSP: 0018:ffffc90007fbf9f0 EFLAGS: 00000246 RAX: 0000000000200000 RBX: 000000057583a39d RCX: ffffffff81fac4a4 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000001 R09: 000000000000002e R10: 000000000000006c R11: 0000000000000001 R12: 0000800000000000 R13: 696c2f343662696c R14: ffff888012129121 R15: ffffc90007fbfc30 link_path_walk fs/namei.c:2257 [inline] path_openat+0x231/0x29a0 fs/namei.c:3798 do_filp_open+0x1de/0x440 fs/namei.c:3829 do_sys_openat2+0x17a/0x1e0 fs/open.c:1404 do_sys_open fs/open.c:1419 [inline] __do_sys_openat fs/open.c:1435 [inline] __se_sys_openat fs/open.c:1430 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1430 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7f54ca69da46 Code: 10 00 00 00 44 8b 54 24 e0 48 89 44 24 c0 48 8d 44 24 d0 48 89 44 24 c8 44 89 c2 4c 89 ce bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 0c f7 d8 89 05 0a 48 01 00 48 83 c8 ff c3 31 RSP: 002b:00007ffe4a9911a8 EFLAGS: 00000287 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007ffe4a991408 RCX: 00007f54ca69da46 RDX: 0000000000080000 RSI: 00007ffe4a991220 RDI: 00000000ffffff9c RBP: 00007ffe4a991210 R08: 0000000000080000 R09: 00007ffe4a991220 R10: 0000000000000000 R11: 0000000000000287 R12: 00007ffe4a991220 R13: 0000000000000012 R14: 00007ffe4a9913ef R15: 00000000ffffffff Allocated by task 9383: 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:372 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:389 kmalloc include/linux/slab.h:590 [inline] p9_client_create+0xcf/0x11b0 net/9p/client.c:980 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:662 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e2/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+0x7c/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7c/0x86 Freed by task 9383: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:643 poison_slab_object mm/kasan/common.c:241 [inline] __kasan_slab_free+0x121/0x1c0 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kfree+0x124/0x370 mm/slub.c:4409 p9_client_create+0x9cb/0x11b0 net/9p/client.c:1051 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:662 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e2/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+0x7c/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x33/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7c/0x86 The buggy address belongs to the object at ffff8880276d7000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff8880276d7000, ffff8880276d7200) The buggy address belongs to the physical page: page:ffffea00009db500 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880276d4800 pfn:0x276d4 head:ffffea00009db500 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888014c42c80 ffffea000075e300 dead000000000003 raw: ffff8880276d7800 000000008010000d 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 8516, tgid 8514 (syz-executor.2), ts 304419515114, free_ts 291458176129 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311 __alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4b0/0x1780 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] __do_kmalloc_node mm/slub.c:3980 [inline] __kmalloc+0x3b8/0x440 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] kzalloc include/linux/slab.h:711 [inline] fib6_info_alloc+0x40/0x100 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x337/0x1af0 net/ipv6/route.c:3749 addrconf_f6i_alloc+0x393/0x660 net/ipv6/route.c:4572 ipv6_add_addr+0x538/0x2030 net/ipv6/addrconf.c:1131 add_addr+0xe0/0x350 net/ipv6/addrconf.c:3158 add_v4_addrs+0x722/0xa00 net/ipv6/addrconf.c:3223 addrconf_sit_config net/ipv6/addrconf.c:3474 [inline] addrconf_init_auto_addrs+0x4df/0x820 net/ipv6/addrconf.c:3511 addrconf_notify+0xe2d/0x18f0 net/ipv6/addrconf.c:3698 notifier_call_chain+0xb9/0x3c0 kernel/notifier.c:93 page last free pid 5174 tgid 5174 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2346 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486 mm_free_pgd kernel/fork.c:801 [inline] __mmdrop+0xd7/0x480 kernel/fork.c:917 mmdrop include/linux/sched/mm.h:54 [inline] mmdrop_sched include/linux/sched/mm.h:82 [inline] mmdrop_lazy_tlb_sched include/linux/sched/mm.h:109 [inline] finish_task_switch.isra.0+0x7ac/0xcb0 kernel/sched/core.c:5299 context_switch kernel/sched/core.c:5403 [inline] __schedule+0xf1a/0x5c60 kernel/sched/core.c:6727 __schedule_loop kernel/sched/core.c:6802 [inline] schedule+0xe9/0x280 kernel/sched/core.c:6817 schedule_hrtimeout_range_clock+0x211/0x440 kernel/time/hrtimer.c:2311 poll_schedule_timeout.constprop.0+0xbc/0x190 fs/select.c:244 do_poll fs/select.c:965 [inline] do_sys_poll+0xae0/0xde0 fs/select.c:1015 __do_sys_ppoll fs/select.c:1121 [inline] __se_sys_ppoll fs/select.c:1101 [inline] __x64_sys_ppoll+0x25a/0x2d0 fs/select.c:1101 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 Memory state around the buggy address: ffff8880276d6f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880276d6f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880276d7000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880276d7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880276d7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 67 3c fb addr32 cmp $0xfb,%al 3: 48 c1 e8 03 shr $0x3,%rax 7: 0f b6 04 38 movzbl (%rax,%rdi,1),%eax b: 84 c0 test %al,%al d: 74 08 je 0x17 f: 3c 03 cmp $0x3,%al 11: 0f 8e f6 07 00 00 jle 0x80d 17: 48 8b 04 24 mov (%rsp),%rax 1b: 31 ff xor %edi,%edi 1d: 8b 00 mov (%rax),%eax 1f: 89 c5 mov %eax,%ebp 21: 89 44 24 18 mov %eax,0x18(%rsp) 25: 83 e5 01 and $0x1,%ebp 28: 89 ee mov %ebp,%esi * 2a: e8 20 1a 91 ff call 0xff911a4f <-- trapping instruction 2f: 85 ed test %ebp,%ebp 31: 0f 85 fc 03 00 00 jne 0x433 37: e8 33 1f 91 ff call 0xff911f6f 3c: 48 89 dd mov %rbx,%rbp 3f: 45 rex.RB