================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff88802b091418 by task syz-executor.3/6301 CPU: 0 PID: 6301 Comm: syz-executor.3 Not tainted 6.9.0-rc3-syzkaller-00058-ga6189a740779 #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:check_kcov_mode kernel/kcov.c:175 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x2d/0x60 kernel/kcov.c:207 Code: fa 65 48 8b 15 b4 81 75 7e 65 8b 05 b5 81 75 7e a9 00 01 ff 00 48 8b 34 24 74 0f f6 c4 01 74 35 8b 82 14 16 00 00 85 c0 74 2b <8b> 82 f0 15 00 00 83 f8 02 75 20 48 8b 8a f8 15 00 00 8b 92 f4 15 RSP: 0000:ffffc9000387f260 EFLAGS: 00000246 RAX: 0000000080000001 RBX: ffffc9000387f388 RCX: ffffffff813cb3f6 RDX: ffff888024f62440 RSI: ffffffff813cb529 RDI: 0000000000000005 RBP: ffffc9000387f350 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: dffffc0000000000 R12: ffffc9000387f390 R13: ffffc9000387f398 R14: ffffc90003878000 R15: 0000000000000001 on_stack arch/x86/include/asm/stacktrace.h:59 [inline] stack_access_ok+0x1c9/0x270 arch/x86/kernel/unwind_orc.c:393 deref_stack_reg arch/x86/kernel/unwind_orc.c:403 [inline] unwind_next_frame+0x1b94/0x23a0 arch/x86/kernel/unwind_orc.c:648 __unwind_start arch/x86/kernel/unwind_orc.c:760 [inline] __unwind_start+0x57e/0x850 arch/x86/kernel/unwind_orc.c:685 unwind_start arch/x86/include/asm/unwind.h:64 [inline] arch_stack_walk+0xb2/0x170 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 save_stack+0x162/0x1f0 mm/page_owner.c:156 __set_page_owner+0x8a/0x7f0 mm/page_owner.c:301 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_mpol+0x275/0x610 mm/mempolicy.c:2264 vma_alloc_folio+0xad/0x160 mm/mempolicy.c:2303 folio_prealloc mm/memory.c:1048 [inline] wp_page_copy mm/memory.c:3263 [inline] do_wp_page+0xe47/0x36f0 mm/memory.c:3660 handle_pte_fault mm/memory.c:5316 [inline] __handle_mm_fault+0x1fbf/0x4a80 mm/memory.c:5441 handle_mm_fault+0x476/0xa00 mm/memory.c:5606 do_user_addr_fault+0x426/0x1080 arch/x86/mm/fault.c:1362 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 RIP: 0023:0xf72b03ec Code: 00 8b 84 24 c8 00 00 00 c7 00 01 00 00 00 68 40 42 0f 00 68 81 00 00 00 50 68 f0 00 00 00 8b 5c 24 20 e8 27 d8 03 00 83 c4 10 <83> 83 d0 60 02 00 01 0f b6 83 b6 f5 b4 00 80 bc 24 cc 01 00 00 00 RSP: 002b:00000000ff90e860 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 00000000f73e8ff4 RCX: 0000000000000081 RDX: 00000000000f4240 RSI: 00000000f73e8ff4 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 6300: 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:1779 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+0x75/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 6300: 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:1779 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+0x75/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88802b091400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88802b091400, ffff88802b091600) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2b090 head: order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff888014c42c80 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 head: 00fff80000000840 ffff888014c42c80 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 head: 00fff80000000002 ffffea0000ac2401 ffffea0000ac2448 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5217, tgid 5217 (syz-executor.2), ts 55292019717, free_ts 55269667728 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] kmalloc_trace+0x2fb/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] mca_alloc net/ipv6/mcast.c:880 [inline] __ipv6_dev_mc_inc+0x2b7/0xc50 net/ipv6/mcast.c:936 ipv6_add_dev+0xa91/0x13f0 net/ipv6/addrconf.c:467 addrconf_notify+0x546/0x19e0 net/ipv6/addrconf.c:3650 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] register_netdevice+0x157d/0x1c40 net/core/dev.c:10310 veth_newlink+0x4f6/0xa10 drivers/net/veth.c:1859 rtnl_newlink_create net/core/rtnetlink.c:3494 [inline] __rtnl_newlink+0x119c/0x1960 net/core/rtnetlink.c:3714 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3727 page last free pid 5217 tgid 5217 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 __put_partials+0x14c/0x170 mm/slub.c:2906 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:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmalloc_trace+0x147/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] kobject_uevent_env+0x265/0x15f0 lib/kobject_uevent.c:525 __kobject_del+0x168/0x1f0 lib/kobject.c:601 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x31c/0x5b0 lib/kobject.c:737 net_rx_queue_update_kobjects+0x478/0x5f0 net/core/net-sysfs.c:1174 netif_set_real_num_rx_queues+0x169/0x210 net/core/dev.c:2941 veth_init_queues+0x151/0x190 drivers/net/veth.c:1759 veth_newlink+0x627/0xa10 drivers/net/veth.c:1877 rtnl_newlink_create net/core/rtnetlink.c:3494 [inline] __rtnl_newlink+0x119c/0x1960 net/core/rtnetlink.c:3714 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3727 Memory state around the buggy address: ffff88802b091300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b091380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802b091400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802b091480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802b091500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: fa cli 1: 65 48 8b 15 b4 81 75 mov %gs:0x7e7581b4(%rip),%rdx # 0x7e7581bd 8: 7e 9: 65 8b 05 b5 81 75 7e mov %gs:0x7e7581b5(%rip),%eax # 0x7e7581c5 10: a9 00 01 ff 00 test $0xff0100,%eax 15: 48 8b 34 24 mov (%rsp),%rsi 19: 74 0f je 0x2a 1b: f6 c4 01 test $0x1,%ah 1e: 74 35 je 0x55 20: 8b 82 14 16 00 00 mov 0x1614(%rdx),%eax 26: 85 c0 test %eax,%eax 28: 74 2b je 0x55 * 2a: 8b 82 f0 15 00 00 mov 0x15f0(%rdx),%eax <-- trapping instruction 30: 83 f8 02 cmp $0x2,%eax 33: 75 20 jne 0x55 35: 48 8b 8a f8 15 00 00 mov 0x15f8(%rdx),%rcx 3c: 8b .byte 0x8b 3d: 92 xchg %eax,%edx 3e: f4 hlt 3f: 15 .byte 0x15