================================================================== BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 Read of size 1 at addr ffff888048885018 by task syz.0.1274/10349 CPU: 3 UID: 0 PID: 10349 Comm: syz.0.1274 Not tainted syzkaller #0 PREEMPT(full) 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:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 __kasan_check_byte+0x36/0x50 mm/kasan/common.c:568 kasan_check_byte include/linux/kasan.h:399 [inline] lock_acquire kernel/locking/lockdep.c:5842 [inline] lock_acquire+0xfc/0x350 kernel/locking/lockdep.c:5825 __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+0x1dc/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2719 [inline] vring_interrupt+0x31e/0x400 drivers/virtio/virtio_ring.c:2694 __handle_irq_event_percpu+0x233/0x920 kernel/irq/handle.c:203 handle_irq_event_percpu kernel/irq/handle.c:240 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:257 handle_edge_irq+0x3ca/0x9e0 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:254 [inline] call_irq_handler arch/x86/kernel/irq.c:310 [inline] __common_interrupt+0xd0/0x2f0 arch/x86/kernel/irq.c:325 common_interrupt+0xba/0xe0 arch/x86/kernel/irq.c:318 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:__sanitizer_cov_trace_pc+0x41/0x70 kernel/kcov.c:217 Code: a9 00 01 ff 00 74 1d f6 c4 01 74 43 a9 00 00 0f 00 75 3c a9 00 00 f0 00 75 35 8b 82 7c 16 00 00 85 c0 74 2b 8b 82 58 16 00 00 <83> f8 02 75 20 48 8b 8a 60 16 00 00 8b 92 5c 16 00 00 48 8b 01 48 RSP: 0018:ffffc900036d7828 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff82075501 RDX: ffff888025618000 RSI: ffffffff82075539 RDI: 0000000000000007 RBP: 00000000000001bb R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 00007fe401845000 R13: ffff88804c0d1228 R14: dffffc0000000000 R15: 0000000000000000 should_zap_cows mm/memory.c:1428 [inline] should_zap_folio mm/memory.c:1440 [inline] zap_present_ptes mm/memory.c:1565 [inline] do_zap_pte_range mm/memory.c:1682 [inline] zap_pte_range mm/memory.c:1726 [inline] zap_pmd_range mm/memory.c:1818 [inline] zap_pud_range mm/memory.c:1847 [inline] zap_p4d_range mm/memory.c:1868 [inline] unmap_page_range+0xd49/0x42c0 mm/memory.c:1889 unmap_single_vma.constprop.0+0x153/0x240 mm/memory.c:1932 unmap_vmas+0x218/0x470 mm/memory.c:1976 exit_mmap+0x1b9/0xb90 mm/mmap.c:1280 __mmput+0x12a/0x410 kernel/fork.c:1130 mmput+0x62/0x70 kernel/fork.c:1153 exit_mm kernel/exit.c:582 [inline] do_exit+0x7c7/0x2bf0 kernel/exit.c:949 do_group_exit+0xd3/0x2a0 kernel/exit.c:1102 __do_sys_exit_group kernel/exit.c:1113 [inline] __se_sys_exit_group kernel/exit.c:1111 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1111 x64_sys_call+0x150b/0x1730 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe40298eec9 Code: Unable to access opcode bytes at 0x7fe40298ee9f. RSP: 002b:00007ffe98d31b18 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe40298eec9 RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffe98d31b7c R08: 0000000298d31c0f R09: 00000000000927c0 R10: 0000000000000001 R11: 0000000000000246 R12: 000000000000015f R13: 00000000000927c0 R14: 00000000000553d9 R15: 00007ffe98d31bd0 Allocated by task 10350: 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:388 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405 kmalloc_noprof include/linux/slab.h:905 [inline] p9_client_create+0xc7/0x11c0 net/9p/client.c:985 v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:666 vfs_get_tree+0x8b/0x340 fs/super.c:1752 do_new_mount fs/namespace.c:3750 [inline] path_mount+0x1516/0x2060 fs/namespace.c:4065 do_mount fs/namespace.c:4078 [inline] __do_sys_mount fs/namespace.c:4278 [inline] __se_sys_mount fs/namespace.c:4255 [inline] __x64_sys_mount+0x28d/0x310 fs/namespace.c:4255 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 10350: 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:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x60/0x70 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2422 [inline] slab_free mm/slub.c:4695 [inline] kfree+0x2b4/0x4d0 mm/slub.c:4894 p9_client_create+0xa28/0x11c0 net/9p/client.c:1064 v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:666 vfs_get_tree+0x8b/0x340 fs/super.c:1752 do_new_mount fs/namespace.c:3750 [inline] path_mount+0x1516/0x2060 fs/namespace.c:4065 do_mount fs/namespace.c:4078 [inline] __do_sys_mount fs/namespace.c:4278 [inline] __se_sys_mount fs/namespace.c:4255 [inline] __x64_sys_mount+0x28d/0x310 fs/namespace.c:4255 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888048885000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888048885000, ffff888048885200) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x48884 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b042c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b042c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0001222101 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 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 9208, tgid 9206 (syz.2.947), ts 282238707330, free_ts 248651158827 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2492 [inline] allocate_slab mm/slub.c:2660 [inline] new_slab+0x247/0x330 mm/slub.c:2714 ___slab_alloc+0xcf2/0x1750 mm/slub.c:3901 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992 __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] __kmalloc_cache_noprof+0xfb/0x3e0 mm/slub.c:4402 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] inetdev_init+0x66/0x5a0 net/ipv4/devinet.c:273 inetdev_event+0xc5f/0x18a0 net/ipv4/devinet.c:1590 notifier_call_chain+0xb9/0x410 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2229 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] register_netdevice+0x182e/0x2270 net/core/dev.c:11244 __ip_tunnel_create+0x540/0x6e0 net/ipv4/ip_tunnel.c:268 ip_tunnel_init_net+0x22f/0x7d0 net/ipv4/ip_tunnel.c:1161 vti_init_net+0x2e/0x140 net/ipv4/ip_vti.c:517 page last free pid 8504 tgid 8504 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4191 [inline] slab_alloc_node mm/slub.c:4240 [inline] kmem_cache_alloc_noprof+0x1cb/0x3b0 mm/slub.c:4247 ptlock_alloc+0x1f/0x70 mm/memory.c:7161 ptlock_init include/linux/mm.h:2953 [inline] pagetable_pte_ctor include/linux/mm.h:3002 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:78 [inline] pte_alloc_one+0x82/0x3a0 arch/x86/mm/pgtable.c:18 do_fault_around mm/memory.c:5525 [inline] do_read_fault mm/memory.c:5564 [inline] do_fault mm/memory.c:5707 [inline] do_pte_missing+0x1afc/0x3ba0 mm/memory.c:4234 handle_pte_fault mm/memory.c:6052 [inline] __handle_mm_fault+0x152a/0x2a50 mm/memory.c:6195 handle_mm_fault+0x589/0xd10 mm/memory.c:6364 do_user_addr_fault+0x60c/0x1370 arch/x86/mm/fault.c:1336 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x5c/0xb0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 Memory state around the buggy address: ffff888048884f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888048884f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888048885000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888048885080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888048885100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: a9 00 01 ff 00 test $0xff0100,%eax 5: 74 1d je 0x24 7: f6 c4 01 test $0x1,%ah a: 74 43 je 0x4f c: a9 00 00 0f 00 test $0xf0000,%eax 11: 75 3c jne 0x4f 13: a9 00 00 f0 00 test $0xf00000,%eax 18: 75 35 jne 0x4f 1a: 8b 82 7c 16 00 00 mov 0x167c(%rdx),%eax 20: 85 c0 test %eax,%eax 22: 74 2b je 0x4f 24: 8b 82 58 16 00 00 mov 0x1658(%rdx),%eax * 2a: 83 f8 02 cmp $0x2,%eax <-- trapping instruction 2d: 75 20 jne 0x4f 2f: 48 8b 8a 60 16 00 00 mov 0x1660(%rdx),%rcx 36: 8b 92 5c 16 00 00 mov 0x165c(%rdx),%edx 3c: 48 8b 01 mov (%rcx),%rax 3f: 48 rex.W