================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2d85/0x3b20 kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff88802a5cd818 by task syz-executor.0/5357 CPU: 3 PID: 5357 Comm: syz-executor.0 Not tainted 6.7.0-rc7-syzkaller-00041-gf016f7547aee #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+0x2d85/0x3b20 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/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:2595 [inline] vring_interrupt+0x317/0x3f0 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+0x261/0xcf0 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+0xdb/0x240 arch/x86/kernel/irq.c:257 common_interrupt+0x52/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:640 RIP: 0010:__do_softirq+0x1e0/0x8de kernel/softirq.c:539 Code: 89 44 24 18 44 88 74 24 3b 48 c7 c7 00 46 cb 8a e8 15 5d fc ff 65 66 c7 05 2b e5 80 75 00 00 e8 a6 42 0a f7 fb bb ff ff ff ff <49> c7 c6 c0 a0 c0 8c 41 0f bc dc 83 c3 01 0f 85 a2 00 00 00 e9 6b RSP: 0000:ffffc90000af8f30 EFLAGS: 00000206 RAX: 000000000000333c RBX: 00000000ffffffff RCX: 1ffffffff23e278e RDX: 0000000000000000 RSI: ffffffff8acc9f40 RDI: ffffffff8b2ed520 RBP: 0000000100001adf R08: 0000000000000001 R09: fffffbfff23e21d0 R10: ffffffff91f10e87 R11: 0000000000000003 R12: 0000000000000202 R13: 000000000000000a R14: 0000000000000001 R15: 0000000000000000 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:arch_static_branch arch/x86/include/asm/jump_label.h:27 [inline] RIP: 0010:static_key_false include/linux/jump_label.h:207 [inline] RIP: 0010:native_write_msr arch/x86/include/asm/msr.h:147 [inline] RIP: 0010:wrmsrl arch/x86/include/asm/msr.h:262 [inline] RIP: 0010:native_x2apic_icr_write arch/x86/include/asm/apic.h:216 [inline] RIP: 0010:__x2apic_send_IPI_dest+0x28/0x40 arch/x86/kernel/apic/x2apic_phys.c:113 Code: 00 00 66 0f 1f 00 89 f0 b9 30 08 00 00 09 d0 80 ce 04 83 fe 02 0f 44 c2 48 89 fa 48 c1 e2 20 89 c0 48 09 d0 48 c1 ea 20 0f 30 <66> 90 c3 31 d2 48 89 c6 bf 30 08 00 00 e9 56 72 59 03 66 0f 1f 44 RSP: 0000:ffffc90003f4f2b8 EFLAGS: 00000202 RAX: 00000004000008fb RBX: 0000000000000001 RCX: 0000000000000830 RDX: 0000000000000004 RSI: 00000000000000fb RDI: 0000000000000004 RBP: dffffc0000000000 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000003 R12: 0000000000000003 R13: ffffffff817abef0 R14: 0000000000000002 R15: ffff88806b93d900 arch_send_call_function_single_ipi arch/x86/include/asm/smp.h:101 [inline] send_call_function_single_ipi kernel/smp.c:117 [inline] smp_call_function_many_cond+0x12cf/0x1550 kernel/smp.c:837 on_each_cpu_cond_mask+0x40/0x90 kernel/smp.c:1023 kvm_flush_tlb_multi+0x267/0x3a0 arch/x86/kernel/kvm.c:675 __flush_tlb_multi arch/x86/include/asm/paravirt.h:87 [inline] flush_tlb_multi arch/x86/mm/tlb.c:944 [inline] flush_tlb_mm_range+0x28f/0x320 arch/x86/mm/tlb.c:1030 flush_tlb_page arch/x86/include/asm/tlbflush.h:254 [inline] ptep_clear_flush+0x132/0x170 mm/pgtable-generic.c:101 wp_page_copy mm/memory.c:3188 [inline] do_wp_page+0x1914/0x36b0 mm/memory.c:3511 handle_pte_fault mm/memory.c:5055 [inline] __handle_mm_fault+0x1d7d/0x3d70 mm/memory.c:5180 handle_mm_fault+0x47a/0xa10 mm/memory.c:5345 do_user_addr_fault+0x3d1/0x1000 arch/x86/mm/fault.c:1413 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline] RIP: 0010:raw_copy_to_user arch/x86/include/asm/uaccess_64.h:133 [inline] RIP: 0010:copy_to_user_iter lib/iov_iter.c:25 [inline] RIP: 0010:iterate_iovec include/linux/iov_iter.h:51 [inline] RIP: 0010:iterate_and_advance2 include/linux/iov_iter.h:247 [inline] RIP: 0010:iterate_and_advance include/linux/iov_iter.h:271 [inline] RIP: 0010:_copy_to_iter+0x4c9/0x11e0 lib/iov_iter.c:186 Code: 45 e8 9b 7c 26 fd 48 8b 4c 24 18 89 ee 48 8b 44 24 28 4c 8d 34 01 4c 89 f7 e8 43 6a 7c fd 0f 01 cb 48 89 e9 4c 89 ff 4c 89 f6 a4 0f 1f 00 0f 01 ca 48 89 e8 48 29 eb 48 29 c8 48 01 cb 48 01 RSP: 0000:ffffc90003f4f970 EFLAGS: 00050246 RAX: 0000000000000001 RBX: 0000000000001000 RCX: 0000000000000e80 RDX: 0000000000000000 RSI: ffff888010b17180 RDI: 0000000020271000 RBP: 0000000000001000 R08: 0000000000000000 R09: ffffed1002162fff R10: ffff888010b17fff R11: 0000000000000000 R12: 0000000000270b80 R13: ffffc90003f4fd60 R14: ffff888010b17000 R15: 0000000020270e80 copy_page_to_iter lib/iov_iter.c:381 [inline] copy_page_to_iter+0xf1/0x180 lib/iov_iter.c:368 process_vm_rw_pages mm/process_vm_access.c:45 [inline] process_vm_rw_single_vec mm/process_vm_access.c:117 [inline] process_vm_rw_core.constprop.0+0x5cd/0xa10 mm/process_vm_access.c:215 process_vm_rw+0x2ff/0x360 mm/process_vm_access.c:283 __do_sys_process_vm_readv mm/process_vm_access.c:295 [inline] __se_sys_process_vm_readv mm/process_vm_access.c:291 [inline] __x64_sys_process_vm_readv+0xe2/0x1b0 mm/process_vm_access.c:291 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f0ce6c7cce9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0ce79d70c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000136 RAX: ffffffffffffffda RBX: 00007f0ce6d9bf80 RCX: 00007f0ce6c7cce9 RDX: 0000000000000002 RSI: 0000000020008400 RDI: 000000000000000d RBP: 00007f0ce6cc947a R08: 0000000000000286 R09: 0000000000000000 R10: 0000000020008640 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f0ce6d9bf80 R15: 00007ffe639e8e48 Allocated by task 5349: 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+0xa3/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] p9_client_create+0xcf/0x1210 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+0x8c/0x370 fs/super.c:1771 do_new_mount fs/namespace.c:3337 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3863 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 5349: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x138/0x190 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] __cache_free mm/slab.c:3370 [inline] __do_kmem_cache_free mm/slab.c:3557 [inline] __kmem_cache_free+0xcc/0x3d0 mm/slab.c:3564 p9_client_create+0xa14/0x1210 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+0x8c/0x370 fs/super.c:1771 do_new_mount fs/namespace.c:3337 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3863 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x7a0 kernel/rcu/tree.c:2681 fib6_info_release include/net/ip6_fib.h:337 [inline] fib6_info_release include/net/ip6_fib.h:334 [inline] ip6_route_info_create+0x1712/0x1b70 net/ipv6/route.c:3829 ip6_route_add+0x26/0x150 net/ipv6/route.c:3843 addrconf_prefix_route+0x2fe/0x510 net/ipv6/addrconf.c:2445 inet6_addr_add+0x605/0xbe0 net/ipv6/addrconf.c:3012 inet6_rtm_newaddr+0x11da/0x1ab0 net/ipv6/addrconf.c:4984 rtnetlink_rcv_msg+0x3c7/0xe00 net/core/rtnetlink.c:6558 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2190 __do_sys_sendto net/socket.c:2202 [inline] __se_sys_sendto net/socket.c:2198 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2198 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff88802a5cd800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88802a5cd800, ffff88802a5cda00) The buggy address belongs to the physical page: page:ffffea0000a97340 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a5cd flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x4() raw: 00fff00000000800 ffff888013040600 ffffea0000725dd0 ffffea000072e450 raw: 0000000000000000 ffff88802a5cd000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 5239, tgid 5239 (syz-executor.2), ts 366229941733, free_ts 363651378267 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568 __alloc_pages_node include/linux/gfp.h:238 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x295/0x3b0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] __kmem_cache_alloc_node+0x3ba/0x460 mm/slab.c:3521 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x49/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:721 [inline] fib6_info_alloc+0x40/0x100 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x337/0x1b70 net/ipv6/route.c:3749 addrconf_f6i_alloc+0x38f/0x660 net/ipv6/route.c:4572 ipv6_add_addr+0x543/0x2040 net/ipv6/addrconf.c:1116 inet6_addr_add+0x3bb/0xbe0 net/ipv6/addrconf.c:3009 inet6_rtm_newaddr+0x11da/0x1ab0 net/ipv6/addrconf.c:4984 rtnetlink_rcv_msg+0x3c7/0xe00 net/core/rtnetlink.c:6558 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1368 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4fa/0xaa0 mm/page_alloc.c:2347 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487 slab_destroy mm/slab.c:1608 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1628 cache_flusharray mm/slab.c:3341 [inline] ___cache_free+0x2b7/0x420 mm/slab.c:3404 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4c/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slab.c:3237 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x159/0x360 mm/slab.c:3432 vm_area_alloc+0x1f/0x220 kernel/fork.c:485 mmap_region+0x3a5/0x2830 mm/mmap.c:2836 do_mmap+0x893/0xef0 mm/mmap.c:1379 vm_mmap_pgoff+0x1a8/0x3c0 mm/util.c:556 ksys_mmap_pgoff+0x422/0x5b0 mm/mmap.c:1425 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:93 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:86 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff88802a5cd700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802a5cd780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802a5cd800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802a5cd880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802a5cd900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 89 44 24 18 mov %eax,0x18(%rsp) 4: 44 88 74 24 3b mov %r14b,0x3b(%rsp) 9: 48 c7 c7 00 46 cb 8a mov $0xffffffff8acb4600,%rdi 10: e8 15 5d fc ff call 0xfffc5d2a 15: 65 66 c7 05 2b e5 80 movw $0x0,%gs:0x7580e52b(%rip) # 0x7580e54a 1c: 75 00 00 1f: e8 a6 42 0a f7 call 0xf70a42ca 24: fb sti 25: bb ff ff ff ff mov $0xffffffff,%ebx * 2a: 49 c7 c6 c0 a0 c0 8c mov $0xffffffff8cc0a0c0,%r14 <-- trapping instruction 31: 41 0f bc dc bsf %r12d,%ebx 35: 83 c3 01 add $0x1,%ebx 38: 0f 85 a2 00 00 00 jne 0xe0 3e: e9 .byte 0xe9 3f: 6b .byte 0x6b