================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007 Read of size 8 at addr ffff88801a96f818 by task kswapd0/113 CPU: 0 UID: 0 PID: 113 Comm: kswapd0 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:arch_static_branch arch/x86/include/asm/jump_label.h:27 [inline] RIP: 0010:page_fixed_fake_head include/linux/page-flags.h:203 [inline] RIP: 0010:page_is_fake_head include/linux/page-flags.h:235 [inline] RIP: 0010:PageTail include/linux/page-flags.h:279 [inline] RIP: 0010:const_folio_flags+0x4f/0x1f0 include/linux/page-flags.h:307 Code: 80 3c 02 00 0f 85 90 01 00 00 4c 8b 65 08 31 ff 41 83 e4 01 4c 89 e6 e8 1f c2 c6 ff 4d 85 e4 0f 85 ff 00 00 00 e8 a1 bf c6 ff <66> 90 e8 9a bf c6 ff e8 95 bf c6 ff 31 ff 89 de e8 cc c1 c6 ff 85 RSP: 0000:ffffc90001faf078 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff81c459f1 RDX: ffff88801b99a440 RSI: ffffffff81c459ff RDI: 0000000000000007 RBP: ffffea0000b0d640 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 000000000003db0c R14: ffffffff8b5b0380 R15: ffffea0000b0d640 folio_test_head include/linux/page-flags.h:827 [inline] folio_test_large include/linux/page-flags.h:848 [inline] folio_nr_pages include/linux/mm.h:2049 [inline] node_stat_add_folio include/linux/vmstat.h:484 [inline] pageout+0x558/0xa10 mm/vmscan.c:693 shrink_folio_list+0x3145/0x41e0 mm/vmscan.c:1360 evict_folios+0x6e0/0x1b30 mm/vmscan.c:4580 try_to_shrink_lruvec+0x612/0x9b0 mm/vmscan.c:4775 shrink_one+0x3e3/0x7b0 mm/vmscan.c:4813 shrink_many mm/vmscan.c:4876 [inline] lru_gen_shrink_node+0x69f/0x1510 mm/vmscan.c:4954 shrink_node mm/vmscan.c:5934 [inline] kswapd_shrink_node mm/vmscan.c:6762 [inline] balance_pgdat+0x110f/0x1950 mm/vmscan.c:6954 kswapd+0x5ea/0xbf0 mm/vmscan.c:7223 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 5921: 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 5921: 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 ffff88801a96f800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88801a96f800, ffff88801a96fa00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801a96f000 pfn:0x1a96c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000240 ffff888015842c80 ffffea0000683010 ffff8880158407c8 raw: ffff88801a96f000 000000000010000b 00000001fdffffff 0000000000000000 head: 00fff00000000240 ffff888015842c80 ffffea0000683010 ffff8880158407c8 head: ffff88801a96f000 000000000010000b 00000001fdffffff 0000000000000000 head: 00fff00000000002 ffffea00006a5b01 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5394, tgid 5394 (kworker/1:3), ts 69932764230, free_ts 69861110701 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] switchdev_deferred_enqueue+0x2b/0x2b0 net/switchdev/switchdev.c:117 switchdev_port_obj_add_defer net/switchdev/switchdev.c:358 [inline] switchdev_port_obj_add+0x103/0x190 net/switchdev/switchdev.c:377 br_switchdev_host_mdb_one net/bridge/br_switchdev.c:559 [inline] br_switchdev_host_mdb+0x2df/0x410 net/bridge/br_switchdev.c:574 br_switchdev_mdb_notify+0x50c/0x5c0 net/bridge/br_switchdev.c:649 br_mdb_notify+0x69/0x6b0 net/bridge/br_mdb.c:529 br_multicast_host_join+0x2a6/0x330 net/bridge/br_multicast.c:1482 __br_multicast_add_group+0x50b/0x650 net/bridge/br_multicast.c:1525 br_multicast_add_group net/bridge/br_multicast.c:1569 [inline] br_ip6_multicast_add_group+0x284/0x330 net/bridge/br_multicast.c:1621 page last free pid 5398 tgid 5398 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 __put_partials+0x14c/0x170 mm/slub.c:3051 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 vm_area_dup+0x21/0x300 kernel/fork.c:486 __split_vma+0x181/0x11a0 mm/mmap.c:2465 do_vmi_align_munmap+0x2bf/0x19c0 mm/mmap.c:2663 do_vmi_munmap+0x231/0x410 mm/mmap.c:2830 mmap_region+0x17f/0x2760 mm/mmap.c:2881 do_mmap+0xbfb/0xfb0 mm/mmap.c:1468 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:588 ksys_mmap_pgoff+0x332/0x5d0 mm/mmap.c:1514 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 Memory state around the buggy address: ffff88801a96f700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801a96f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801a96f800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801a96f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801a96f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) 4: 0f 85 90 01 00 00 jne 0x19a a: 4c 8b 65 08 mov 0x8(%rbp),%r12 e: 31 ff xor %edi,%edi 10: 41 83 e4 01 and $0x1,%r12d 14: 4c 89 e6 mov %r12,%rsi 17: e8 1f c2 c6 ff call 0xffc6c23b 1c: 4d 85 e4 test %r12,%r12 1f: 0f 85 ff 00 00 00 jne 0x124 25: e8 a1 bf c6 ff call 0xffc6bfcb * 2a: 66 90 xchg %ax,%ax <-- trapping instruction 2c: e8 9a bf c6 ff call 0xffc6bfcb 31: e8 95 bf c6 ff call 0xffc6bfcb 36: 31 ff xor %edi,%edi 38: 89 de mov %ebx,%esi 3a: e8 cc c1 c6 ff call 0xffc6c20b 3f: 85 .byte 0x85