================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007 Read of size 8 at addr ffff88802a513c18 by task kswapd0/112 CPU: 0 UID: 0 PID: 112 Comm: kswapd0 Not tainted 6.11.0-rc5-syzkaller-00079-g928f79a188aa #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:preempt_count arch/x86/include/asm/preempt.h:26 [inline] RIP: 0010:check_kcov_mode kernel/kcov.c:182 [inline] RIP: 0010:write_comp_data+0x11/0x90 kernel/kcov.c:245 Code: cc cc cc cc 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 49 89 d2 49 89 f8 49 89 f1 65 48 8b 15 cf c0 78 7e <65> 8b 05 d0 c0 78 7e a9 00 01 ff 00 74 1d f6 c4 01 74 67 a9 00 00 RSP: 0000:ffffc90000e3f738 EFLAGS: 00000246 RAX: 1ffff11004bb712f RBX: 0000000000000018 RCX: ffffffff81f29afe RDX: ffff88801a732440 RSI: 000000000000003b RDI: 0000000000000006 RBP: ffff8880263f40c8 R08: 0000000000000006 R09: 000000000000003b R10: 0000000000000014 R11: 0000000000000000 R12: dffffc0000000000 R13: 000000000000003b R14: 0000000000000014 R15: ffff888025db8800 zs_can_compact mm/zsmalloc.c:1927 [inline] zs_shrinker_count+0x11e/0x240 mm/zsmalloc.c:2061 do_shrink_slab+0x82/0x11c0 mm/shrinker.c:382 shrink_slab+0x330/0x12c0 mm/shrinker.c:662 shrink_one+0x47e/0x7b0 mm/vmscan.c:4815 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 6715: 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 6715: 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 ffff88802a513c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88802a513c00, ffff88802a513e00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802a510800 pfn:0x2a510 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 ffffea0000a22210 ffffea000079b210 raw: ffff88802a510800 000000000010000f 00000001fdffffff 0000000000000000 head: 00fff00000000240 ffff888015842c80 ffffea0000a22210 ffffea000079b210 head: ffff88802a510800 000000000010000f 00000001fdffffff 0000000000000000 head: 00fff00000000002 ffffea0000a94401 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5549, tgid 5549 (syz-executor), ts 87512400322, free_ts 83471811437 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 ip6_route_add+0x26/0x1c0 net/ipv6/route.c:3853 addrconf_prefix_route+0x2fe/0x510 net/ipv6/addrconf.c:2486 add_v4_addrs+0x74b/0xa00 net/ipv6/addrconf.c:3269 addrconf_gre_config net/ipv6/addrconf.c:3544 [inline] addrconf_init_auto_addrs+0x18a/0x820 net/ipv6/addrconf.c:3562 addrconf_notify+0xe9e/0x19d0 net/ipv6/addrconf.c:3743 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 page last free pid 44 tgid 44 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 __folio_put+0x31c/0x3e0 mm/swap.c:128 folio_put include/linux/mm.h:1486 [inline] migrate_folio_done+0x271/0x310 mm/migrate.c:1108 migrate_folio_move mm/migrate.c:1330 [inline] migrate_pages_batch+0x1ca0/0x3150 mm/migrate.c:1818 migrate_pages_sync mm/migrate.c:1884 [inline] migrate_pages+0x1b66/0x27a0 mm/migrate.c:1993 compact_zone+0x1f68/0x4280 mm/compaction.c:2671 compact_node+0x1a2/0x2d0 mm/compaction.c:2935 kcompactd+0x76e/0xde0 mm/compaction.c:3233 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 Memory state around the buggy address: ffff88802a513b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802a513b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802a513c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802a513c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802a513d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: cc int3 1: cc int3 2: cc int3 3: cc int3 4: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 9: 90 nop a: 90 nop b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 49 89 d2 mov %rdx,%r10 1c: 49 89 f8 mov %rdi,%r8 1f: 49 89 f1 mov %rsi,%r9 22: 65 48 8b 15 cf c0 78 mov %gs:0x7e78c0cf(%rip),%rdx # 0x7e78c0f9 29: 7e * 2a: 65 8b 05 d0 c0 78 7e mov %gs:0x7e78c0d0(%rip),%eax # 0x7e78c101 <-- trapping instruction 31: a9 00 01 ff 00 test $0xff0100,%eax 36: 74 1d je 0x55 38: f6 c4 01 test $0x1,%ah 3b: 74 67 je 0xa4 3d: a9 .byte 0xa9