================================================================== BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:132 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:166 Read of size 1 at addr ffff888056d8cc18 by task syz-executor/10634 CPU: 3 UID: 0 PID: 10634 Comm: syz-executor 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+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1d0 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+0x12a/0x370 kernel/locking/lockdep.c:5825 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:132 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:166 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+0x2ef/0x650 drivers/virtio/virtio_ring.c:3254 __handle_irq_event_percpu+0x235/0x8c0 kernel/irq/handle.c:209 handle_irq_event_percpu kernel/irq/handle.c:246 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:263 handle_edge_irq+0x35e/0x960 kernel/irq/chip.c:856 generic_handle_irq_desc include/linux/irqdesc.h:186 [inline] handle_irq arch/x86/kernel/irq.c:262 [inline] call_irq_handler arch/x86/kernel/irq.c:318 [inline] __common_interrupt+0xd8/0x2f0 arch/x86/kernel/irq.c:333 common_interrupt+0xb9/0xe0 arch/x86/kernel/irq.c:326 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:csd_lock_wait kernel/smp.c:342 [inline] RIP: 0010:smp_call_function_single+0x20b/0x710 kernel/smp.c:702 Code: 89 84 24 d8 00 00 00 e8 a3 f9 ff ff 89 44 24 2c 0f 1f 44 00 00 e8 b5 5b 0c 00 eb 07 e8 ae 5b 0c 00 f3 90 8b 9c 24 c8 00 00 00 <31> ff 83 e3 01 89 de e8 49 56 0c 00 85 db 75 e2 e8 90 5b 0c 00 e8 RSP: 0018:ffffc9000356fa40 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000011 RCX: ffffffff81fc3007 RDX: ffff88805b584a00 RSI: ffffffff81fc2ff2 RDI: ffff88805b584a00 RBP: ffffc9000356fba0 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000003 R13: 0000000000000000 R14: ffff88806a63c280 R15: ffff88806a63c3c8 rcu_barrier kernel/rcu/tree.c:3880 [inline] rcu_barrier+0x2a4/0x6d0 kernel/rcu/tree.c:3817 flush_rcu_work+0x54/0xd0 kernel/workqueue.c:4412 __kvfree_rcu_barrier+0xec/0x1a0 mm/slab_common.c:2081 kvfree_rcu_barrier_on_cache mm/slab_common.c:2121 [inline] kmem_cache_destroy mm/slab_common.c:535 [inline] kmem_cache_destroy+0x37/0x180 mm/slab_common.c:527 p9_client_destroy+0x20c/0x3a0 net/9p/client.c:965 v9fs_session_close+0x49/0x2d0 fs/9p/v9fs.c:543 v9fs_kill_super+0x4d/0xa0 fs/9p/vfs_super.c:175 deactivate_locked_super+0xc1/0x1b0 fs/super.c:476 deactivate_super fs/super.c:509 [inline] deactivate_super+0xe7/0x110 fs/super.c:505 cleanup_mnt+0x21f/0x450 fs/namespace.c:1312 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:67 [inline] exit_to_user_mode_loop+0x100/0x4a0 kernel/entry/common.c:98 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:238 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline] do_syscall_64+0x706/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe90599e017 Code: a2 c7 05 dc 06 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007fff96e2f008 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 00007fe905a32120 RCX: 00007fe90599e017 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007fff96e2f0c0 RBP: 00007fff96e2f0c0 R08: 00007fff96e300c0 R09: 00000000ffffffff R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff96e301b0 R13: 00007fe905a32120 R14: 000000000005d62a R15: 00007fff96e31280 Allocated by task 16598: 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:950 [inline] p9_client_create+0xaf/0xd40 net/9p/client.c:862 v9fs_session_init+0x3c/0xd20 fs/9p/v9fs.c:446 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x92/0x320 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount fs/namespace.c:3834 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4154 do_mount fs/namespace.c:4167 [inline] __do_sys_mount fs/namespace.c:4383 [inline] __se_sys_mount fs/namespace.c:4360 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4360 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 16598: 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:2689 [inline] slab_free mm/slub.c:6246 [inline] kfree+0x223/0x6c0 mm/slub.c:6561 p9_client_create+0x72d/0xd40 net/9p/client.c:941 v9fs_session_init+0x3c/0xd20 fs/9p/v9fs.c:446 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x92/0x320 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount fs/namespace.c:3834 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4154 do_mount fs/namespace.c:4167 [inline] __do_sys_mount fs/namespace.c:4383 [inline] __se_sys_mount fs/namespace.c:4360 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4360 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888056d8cc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888056d8cc00, ffff888056d8ce00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x56d8c 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 0000000800100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffffffffffff01 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 5735, tgid 5735 (udevd), ts 58561784684, free_ts 58547215273 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858 prep_new_page mm/page_alloc.c:1866 [inline] get_page_from_freelist+0x11a6/0x33b0 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x27c/0x2bc0 mm/page_alloc.c:5226 alloc_slab_page mm/slub.c:3278 [inline] allocate_slab mm/slub.c:3467 [inline] new_slab+0xa6/0x6c0 mm/slub.c:3525 refill_objects+0x277/0x420 mm/slub.c:7251 refill_sheaf mm/slub.c:2816 [inline] __pcs_replace_empty_main+0x375/0x650 mm/slub.c:4651 alloc_from_pcs mm/slub.c:4749 [inline] slab_alloc_node mm/slub.c:4883 [inline] __kmalloc_cache_noprof+0x493/0x6f0 mm/slub.c:5410 kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] kernfs_fop_open+0x23d/0xd50 fs/kernfs/file.c:641 do_dentry_open+0x6d8/0x1660 fs/open.c:947 vfs_open+0x82/0x3f0 fs/open.c:1079 do_open fs/namei.c:4699 [inline] path_openat+0x208c/0x31a0 fs/namei.c:4858 do_file_open+0x20e/0x430 fs/namei.c:4887 do_sys_openat2+0x10d/0x1e0 fs/open.c:1364 do_sys_open fs/open.c:1370 [inline] __do_sys_openat fs/open.c:1386 [inline] __se_sys_openat fs/open.c:1381 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1381 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5817 tgid 5817 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x747/0x1040 mm/page_alloc.c:2943 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 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:4569 [inline] slab_alloc_node mm/slub.c:4898 [inline] __kmalloc_cache_noprof+0x243/0x6f0 mm/slub.c:5410 kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] nsim_fib6_rt_create drivers/net/netdevsim/fib.c:547 [inline] nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:752 [inline] nsim_fib6_event drivers/net/netdevsim/fib.c:856 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:889 [inline] nsim_fib_event_work+0x157b/0x63b0 drivers/net/netdevsim/fib.c:1493 process_one_work+0xa0e/0x1980 kernel/workqueue.c:3302 process_scheduled_works kernel/workqueue.c:3385 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3466 kthread+0x370/0x450 kernel/kthread.c:436 ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888056d8cb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888056d8cb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888056d8cc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888056d8cc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888056d8cd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 89 84 24 d8 00 00 00 mov %eax,0xd8(%rsp) 7: e8 a3 f9 ff ff call 0xfffff9af c: 89 44 24 2c mov %eax,0x2c(%rsp) 10: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 15: e8 b5 5b 0c 00 call 0xc5bcf 1a: eb 07 jmp 0x23 1c: e8 ae 5b 0c 00 call 0xc5bcf 21: f3 90 pause 23: 8b 9c 24 c8 00 00 00 mov 0xc8(%rsp),%ebx * 2a: 31 ff xor %edi,%edi <-- trapping instruction 2c: 83 e3 01 and $0x1,%ebx 2f: 89 de mov %ebx,%esi 31: e8 49 56 0c 00 call 0xc567f 36: 85 db test %ebx,%ebx 38: 75 e2 jne 0x1c 3a: e8 90 5b 0c 00 call 0xc5bcf 3f: e8 .byte 0xe8