================================================================== 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 ffff888033c15818 by task modprobe/11901 CPU: 3 UID: 0 PID: 11901 Comm: modprobe Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP 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:574 kasan_check_byte include/linux/kasan.h:402 [inline] lock_acquire kernel/locking/lockdep.c:5842 [inline] lock_acquire+0xfc/0x330 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:274 [inline] p9_req_put net/9p/client.c:282 [inline] p9_req_put+0xaf/0x250 net/9p/client.c:279 req_done+0x1dc/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt+0x2cf/0x440 drivers/virtio/virtio_ring.c:2718 __handle_irq_event_percpu+0x236/0x890 kernel/irq/handle.c:211 handle_irq_event_percpu kernel/irq/handle.c:248 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:265 handle_edge_irq+0x3ca/0x9e0 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:172 [inline] handle_irq arch/x86/kernel/irq.c:255 [inline] call_irq_handler arch/x86/kernel/irq.c:311 [inline] __common_interrupt+0xd0/0x2f0 arch/x86/kernel/irq.c:326 common_interrupt+0x61/0xe0 arch/x86/kernel/irq.c:319 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:handle_softirqs+0x1dd/0x950 kernel/softirq.c:608 Code: 88 6c 24 26 4c 89 7c 24 18 48 c7 c7 a0 06 8c 8b e8 b8 3e fa 09 65 66 c7 05 76 cf 34 12 00 00 e8 69 2a 49 00 fb bb ff ff ff ff <49> c7 c7 c0 c0 00 8e 41 0f bc dc 83 c3 01 0f 85 a4 00 00 00 e9 7d RSP: 0018:ffffc900006f8f28 EFLAGS: 00000202 RAX: 0000000000000f08 RBX: 00000000ffffffff RCX: 0000000000000002 RDX: 0000000000000000 RSI: ffffffff8dacdf79 RDI: ffffffff8bf2b400 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff9088b6d7 R11: ffff88802cd2d4b0 R12: 0000000000000202 R13: 000000000000000a R14: 1ffff920000df1ed R15: ffffed10059a5930 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1056 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:_compound_head include/linux/page-flags.h:286 [inline] RIP: 0010:free_pages_and_swap_cache+0x132/0x4a0 mm/swap_state.c:346 Code: 85 e8 02 00 00 4d 8b 75 00 4c 89 f5 48 83 e5 fc 48 8d 7d 08 48 89 f8 48 c1 e8 03 42 80 3c 20 00 0f 85 1d 03 00 00 48 8b 45 08 <31> ff 49 89 c7 48 89 44 24 10 41 83 e7 01 4c 89 fe e8 c8 78 9f ff RSP: 0018:ffffc90003fff8c0 EFLAGS: 00000246 RAX: ffffea0001210748 RBX: 0000000000000034 RCX: ffff88802b7b0010 RDX: ffff88802cd2c980 RSI: ffffffff821f6a70 RDI: ffffea0001210788 RBP: ffffea0001210780 R08: 0000000000000004 R09: 0000000000000090 R10: 0000000000000034 R11: ffff88802cd2d4b0 R12: dffffc0000000000 R13: ffff88802b7b01b0 R14: ffffea0001210780 R15: 0000000000000014 __tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:397 [inline] tlb_flush_mmu mm/mmu_gather.c:404 [inline] tlb_finish_mmu+0x168/0x7c0 mm/mmu_gather.c:497 exit_mmap+0x3f9/0xb60 mm/mmap.c:1290 __mmput+0x12a/0x410 kernel/fork.c:1173 mmput+0x62/0x70 kernel/fork.c:1196 exit_mm kernel/exit.c:581 [inline] do_exit+0x7d7/0x2bd0 kernel/exit.c:959 do_group_exit+0xd3/0x2a0 kernel/exit.c:1112 __do_sys_exit_group kernel/exit.c:1123 [inline] __se_sys_exit_group kernel/exit.c:1121 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1121 x64_sys_call+0x151c/0x1740 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1b489676c5 Code: Unable to access opcode bytes at 0x7f1b4896769b. RSP: 002b:00007ffde688ad48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007f1b48a68fe8 RCX: 00007f1b489676c5 RDX: 00000000000000e7 RSI: ffffffffffffff88 RDI: 0000000000000001 RBP: 0000000000000001 R08: 00007ffde688acd8 R09: 0000000000000000 R10: 00007ffde688ab70 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f1b48a67680 R15: 00007f1b48a69000 Allocated by task 11903: kasan_save_stack+0x33/0x60 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:957 [inline] p9_client_create+0xae/0xe40 net/9p/client.c:862 v9fs_session_init+0x40/0xd40 fs/9p/v9fs.c:442 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x8e/0x330 fs/super.c:1751 fc_mount fs/namespace.c:1199 [inline] do_new_mount_fc fs/namespace.c:3636 [inline] do_new_mount fs/namespace.c:3712 [inline] path_mount+0x7bf/0x23a0 fs/namespace.c:4022 do_mount fs/namespace.c:4035 [inline] __do_sys_mount fs/namespace.c:4224 [inline] __se_sys_mount fs/namespace.c:4201 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4201 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 11903: kasan_save_stack+0x33/0x60 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6670 [inline] kfree+0x2f8/0x6e0 mm/slub.c:6878 p9_client_create+0x6c5/0xe40 net/9p/client.c:941 v9fs_session_init+0x40/0xd40 fs/9p/v9fs.c:442 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x8e/0x330 fs/super.c:1751 fc_mount fs/namespace.c:1199 [inline] do_new_mount_fc fs/namespace.c:3636 [inline] do_new_mount fs/namespace.c:3712 [inline] path_mount+0x7bf/0x23a0 fs/namespace.c:4022 do_mount fs/namespace.c:4035 [inline] __do_sys_mount fs/namespace.c:4224 [inline] __se_sys_mount fs/namespace.c:4201 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4201 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888033c15800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888033c15800, ffff888033c15a00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x33c14 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 ffff88801b442c80 ffffea0000cde200 dead000000000002 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b442c80 ffffea0000cde200 dead000000000002 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0000cf0501 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 5930, tgid 5930 (syz-executor), ts 55193246903, free_ts 22844312545 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1857 prep_new_page mm/page_alloc.c:1865 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __kmalloc_cache_noprof+0x485/0x800 mm/slub.c:5771 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] device_private_init drivers/base/core.c:3534 [inline] device_add+0xcf2/0x1980 drivers/base/core.c:3585 netdev_register_kobject+0x1a9/0x3d0 net/core/net-sysfs.c:2358 register_netdevice+0x13ac/0x21d0 net/core/dev.c:11393 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1061 [inline] nsim_create+0xdd5/0x13f0 drivers/net/netdevsim/netdev.c:1143 __nsim_dev_port_add+0x451/0x7a0 drivers/net/netdevsim/dev.c:1493 nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1549 [inline] nsim_drv_probe+0xebb/0x15c0 drivers/net/netdevsim/dev.c:1709 call_driver_probe drivers/base/dd.c:581 [inline] really_probe+0x241/0xb20 drivers/base/dd.c:659 __driver_probe_device+0x1de/0x470 drivers/base/dd.c:801 page last free pid 9 tgid 9 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943 vfree+0x1fd/0xb50 mm/vmalloc.c:3466 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:3385 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Memory state around the buggy address: ffff888033c15700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888033c15780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888033c15800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888033c15880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888033c15900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 88 6c 24 26 mov %ch,0x26(%rsp) 4: 4c 89 7c 24 18 mov %r15,0x18(%rsp) 9: 48 c7 c7 a0 06 8c 8b mov $0xffffffff8b8c06a0,%rdi 10: e8 b8 3e fa 09 call 0x9fa3ecd 15: 65 66 c7 05 76 cf 34 movw $0x0,%gs:0x1234cf76(%rip) # 0x1234cf95 1c: 12 00 00 1f: e8 69 2a 49 00 call 0x492a8d 24: fb sti 25: bb ff ff ff ff mov $0xffffffff,%ebx * 2a: 49 c7 c7 c0 c0 00 8e mov $0xffffffff8e00c0c0,%r15 <-- trapping instruction 31: 41 0f bc dc bsf %r12d,%ebx 35: 83 c3 01 add $0x1,%ebx 38: 0f 85 a4 00 00 00 jne 0xe2 3e: e9 .byte 0xe9 3f: 7d .byte 0x7d