================================================================== 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 ffff888039925818 by task syz.7.3293/27054 CPU: 3 UID: 0 PID: 27054 Comm: syz.7.3293 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 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1a0 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+0xf5/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+0x33b/0x430 drivers/virtio/virtio_ring.c:2718 __handle_irq_event_percpu+0x232/0x800 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+0x375/0x970 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+0xd8/0x2f0 arch/x86/kernel/irq.c:326 common_interrupt+0xb9/0xe0 arch/x86/kernel/irq.c:319 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:194 Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 a6 8c 69 f6 48 89 df e8 8e da 69 f6 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 45 29 5a f6 65 8b 05 3e ba 6a 08 85 c0 74 16 5b RSP: 0018:ffffc90005fb7b68 EFLAGS: 00000246 RAX: 0000000000000002 RBX: ffff888064b58a50 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8dc454ef RDI: ffffffff8bfa35a0 RBP: 0000000000000206 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff888064b58000 R13: ffff888064b58a50 R14: 0000000000000003 R15: ffff888064b58a4f class_raw_spinlock_irqsave_destructor include/linux/spinlock.h:557 [inline] try_to_wake_up+0x403/0x1a60 kernel/sched/core.c:4106 wake_up_process kernel/sched/core.c:4349 [inline] wake_up_q+0xa1/0x130 kernel/sched/core.c:1087 futex_wake+0x460/0x530 kernel/futex/waitwake.c:198 do_futex+0x32b/0x350 kernel/futex/syscalls.c:135 __do_sys_futex kernel/futex/syscalls.c:207 [inline] __se_sys_futex kernel/futex/syscalls.c:188 [inline] __x64_sys_futex+0x34f/0x4d0 kernel/futex/syscalls.c:188 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f353f39aeb9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff41b0d168 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f353f39aeb9 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f353f615fa8 RBP: 00000000000010a0 R08: 0000000000000008 R09: 0000000000000000 R10: 00007f353f615fa0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f353f615fac R14: 00007f353f615fa8 R15: 00007f353f615fa0 Allocated by task 27055: kasan_save_stack+0x30/0x50 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+0xaf/0xd40 net/9p/client.c:862 v9fs_session_init+0x40/0xce0 fs/9p/v9fs.c:442 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x92/0x320 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+0x7d0/0x23c0 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+0xc9/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 27055: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 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:6674 [inline] kfree+0x1c7/0x690 mm/slub.c:6882 p9_client_create+0x72d/0xd40 net/9p/client.c:941 v9fs_session_init+0x40/0xce0 fs/9p/v9fs.c:442 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x92/0x320 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+0x7d0/0x23c0 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+0xc9/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888039925800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888039925800, ffff888039925a00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x39924 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 ffff88801b842c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0000e64901 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 26274, tgid 26273 (syz.4.3150), ts 403243175810, free_ts 398875263660 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240 alloc_slab_page mm/slub.c:3077 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0xaf/0x440 mm/slub.c:3302 ___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656 __slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_node_noprof+0x62b/0x9e0 mm/slub.c:5663 kmalloc_array_node_noprof include/linux/slab.h:1075 [inline] alloc_slab_obj_exts+0x46/0x110 mm/slub.c:2123 account_slab mm/slub.c:3202 [inline] allocate_slab mm/slub.c:3267 [inline] new_slab+0x354/0x440 mm/slub.c:3302 ___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656 __slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_noprof+0x618/0x9c0 mm/slub.c:5669 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] io_alloc_ocqe+0xd6/0x510 io_uring/io_uring.c:728 io_cqe_overflow_locked io_uring/io_uring.c:868 [inline] __io_submit_flush_completions.cold+0x91/0xae io_uring/io_uring.c:1532 io_submit_flush_completions io_uring/io_uring.h:239 [inline] io_submit_state_end io_uring/io_uring.c:2335 [inline] io_submit_sqes+0xc02/0x21c0 io_uring/io_uring.c:2450 __do_sys_io_uring_enter+0x6b4/0x15b0 io_uring/io_uring.c:3285 page last free pid 22090 tgid 22090 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x822/0x1130 mm/page_alloc.c:2973 discard_slab mm/slub.c:3346 [inline] __put_partials+0x127/0x160 mm/slub.c:3886 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xe0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_lru_noprof+0x2c7/0x7d0 mm/slub.c:5282 shmem_alloc_inode+0x25/0x50 mm/shmem.c:5152 alloc_inode+0x68/0x250 fs/inode.c:346 new_inode+0x22/0x1c0 fs/inode.c:1175 __shmem_get_inode mm/shmem.c:3068 [inline] shmem_get_inode+0x197/0xf30 mm/shmem.c:3142 shmem_mknod+0x1a2/0x3b0 mm/shmem.c:3872 lookup_open.isra.0+0x139b/0x1890 fs/namei.c:4449 open_last_lookups fs/namei.c:4549 [inline] path_openat+0x117d/0x3120 fs/namei.c:4793 do_filp_open+0x1f7/0x420 fs/namei.c:4823 do_sys_openat2+0x12e/0x220 fs/open.c:1430 do_sys_open fs/open.c:1436 [inline] __do_sys_openat fs/open.c:1452 [inline] __se_sys_openat fs/open.c:1447 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1447 Memory state around the buggy address: ffff888039925700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888039925780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888039925800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888039925880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888039925900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: f5 cmc 1: 53 push %rbx 2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi 7: 48 89 fb mov %rdi,%rbx a: 48 83 c7 18 add $0x18,%rdi e: e8 a6 8c 69 f6 call 0xf6698cb9 13: 48 89 df mov %rbx,%rdi 16: e8 8e da 69 f6 call 0xf669daa9 1b: f7 c5 00 02 00 00 test $0x200,%ebp 21: 75 23 jne 0x46 23: 9c pushf 24: 58 pop %rax 25: f6 c4 02 test $0x2,%ah 28: 75 37 jne 0x61 * 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2f: e8 45 29 5a f6 call 0xf65a2979 34: 65 8b 05 3e ba 6a 08 mov %gs:0x86aba3e(%rip),%eax # 0x86aba79 3b: 85 c0 test %eax,%eax 3d: 74 16 je 0x55 3f: 5b pop %rbx