================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x23b/0x260 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff88803733cc04 by task syz-executor/18533 CPU: 3 UID: 0 PID: 18533 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/0x1c0 mm/kasan/report.c:595 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x23b/0x260 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock_irqsave+0x42/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/0x660 drivers/virtio/virtio_ring.c:3297 __handle_irq_event_percpu+0x232/0x880 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+0x34c/0x950 kernel/irq/chip.c:859 generic_handle_irq_desc include/linux/irqdesc.h:188 [inline] handle_irq arch/x86/kernel/irq.c:209 [inline] call_irq_handler arch/x86/kernel/irq.c:265 [inline] __common_interrupt+0xd8/0x2f0 arch/x86/kernel/irq.c:280 common_interrupt+0x60/0xe0 arch/x86/kernel/irq.c:273 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:665 RIP: 0010:handle_softirqs+0x1ad/0x9b0 kernel/softirq.c:608 Code: 20 44 88 74 24 1e 45 89 ee 48 c7 c7 80 7a ad 8b e8 f8 c3 cb 09 31 d2 65 66 89 15 d6 e8 46 12 e8 19 bc 49 00 fb bb ff ff ff ff <49> c7 c4 c0 a0 40 8e 41 0f bc de 83 c3 01 0f 85 a4 00 00 00 e9 1b RSP: 0018:ffffc900006f8f28 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 00000000ffffffff RCX: ffffffff8211b23f RDX: 0000000000000000 RSI: ffffffff8c1cef00 RDI: ffffffff81c7f767 RBP: 000000010000263b R08: 0000000000000000 R09: fffffbfff21b3292 R10: 0000000000000000 R11: 0000000000000362 R12: 000000000000000a R13: 0000000000000282 R14: 0000000000000282 R15: 1ffff920000df1ec __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0x162/0x210 kernel/softirq.c:735 irq_exit_rcu+0x9/0x30 kernel/softirq.c:752 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:179 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:198 Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 46 71 4e f6 48 89 df e8 ce c0 4e f6 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 15 cf 3d f6 65 8b 05 1e 49 78 08 85 c0 74 16 5b RSP: 0018:ffffc90004007ba8 EFLAGS: 00000246 RAX: 0000000000000046 RBX: ffff888054f3afb8 RCX: ffffffff8211b23f RDX: 0000000000000000 RSI: ffffffff8c1cef00 RDI: ffffffff8b969722 RBP: 0000000000000246 R08: 0000000000000000 R09: fffffbfff21b3292 R10: 0000000000000000 R11: 0000000000000002 R12: ffff88806a63c220 R13: ffff88806a63b340 R14: ffff888054f3a848 R15: ffff88806a63bf20 task_rq_unlock kernel/sched/sched.h:1959 [inline] wake_up_new_task+0x88c/0xeb0 kernel/sched/core.c:4975 kernel_clone+0x297/0x9d0 kernel/fork.c:2776 __do_sys_clone+0xd9/0x120 kernel/fork.c:2886 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8d3f1c58d2 Code: 89 e7 e8 71 8b f7 ff 45 31 c0 31 d2 31 f6 64 48 8b 04 25 10 00 00 00 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 66 89 c5 85 c0 75 3b 64 48 8b 04 25 10 00 00 RSP: 002b:00007ffd9c935c70 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007ffd9c935c70 RCX: 00007f8d3f1c58d2 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 00007ffd9c935dfc R08: 0000000000000000 R09: 0000000000000001 R10: 000055557f4217d0 R11: 0000000000000246 R12: 0000000000000001 R13: 00000000000927c0 R14: 0000000000061634 R15: 00007ffd9c935e50 Allocated by task 19815: 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:969 [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:1694 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount fs/namespace.c:3841 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4161 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount fs/namespace.c:4367 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4367 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 19815: 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:2700 [inline] slab_free mm/slub.c:6310 [inline] kfree+0x22b/0x6c0 mm/slub.c:6625 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:1694 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount fs/namespace.c:3841 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4161 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount fs/namespace.c:4367 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4367 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803733cc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 4 bytes inside of freed 512-byte region [ffff88803733cc00, ffff88803733ce00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3733c 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 5734, tgid 5734 (syz-executor), ts 46440622872, free_ts 27046743398 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1853 prep_new_page mm/page_alloc.c:1861 [inline] get_page_from_freelist+0x812/0x3d20 mm/page_alloc.c:3941 __alloc_frozen_pages_noprof+0x27c/0x2b60 mm/page_alloc.c:5221 alloc_slab_page mm/slub.c:3289 [inline] allocate_slab mm/slub.c:3404 [inline] new_slab+0xa2/0x670 mm/slub.c:3447 refill_objects+0xe3/0x430 mm/slub.c:7241 refill_sheaf mm/slub.c:2827 [inline] __pcs_replace_empty_main+0x375/0x660 mm/slub.c:4692 alloc_from_pcs mm/slub.c:4790 [inline] slab_alloc_node mm/slub.c:4924 [inline] __kmalloc_cache_noprof+0x48d/0x6e0 mm/slub.c:5446 _kmalloc_noprof include/linux/slab.h:969 [inline] _kzalloc_noprof include/linux/slab.h:1286 [inline] inetdev_init+0x66/0x570 net/ipv4/devinet.c:273 inetdev_event+0x7fa/0x17f0 net/ipv4/devinet.c:1590 notifier_call_chain+0x99/0x3f0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2250 call_netdevice_notifiers_extack net/core/dev.c:2288 [inline] call_netdevice_notifiers net/core/dev.c:2302 [inline] register_netdevice+0x1998/0x25a0 net/core/dev.c:11477 veth_newlink+0x316/0xa00 drivers/net/veth.c:1861 rtnl_newlink_create net/core/rtnetlink.c:3905 [inline] __rtnl_newlink net/core/rtnetlink.c:4036 [inline] rtnl_newlink+0x1499/0x2380 net/core/rtnetlink.c:4151 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7068 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556 page last free pid 5490 tgid 5490 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1397 [inline] __free_frozen_pages+0x794/0x10a0 mm/page_alloc.c:2938 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:4610 [inline] slab_alloc_node mm/slub.c:4939 [inline] __kmalloc_cache_noprof+0x243/0x6e0 mm/slub.c:5446 _kmalloc_noprof include/linux/slab.h:969 [inline] _kzalloc_noprof include/linux/slab.h:1286 [inline] tomoyo_dump_page+0x410/0x540 security/tomoyo/domain.c:916 tomoyo_scan_bprm security/tomoyo/condition.c:130 [inline] tomoyo_condition+0x749/0x3b60 security/tomoyo/condition.c:1120 tomoyo_check_acl+0x1b7/0x410 security/tomoyo/domain.c:177 tomoyo_execute_permission+0x176/0x4b0 security/tomoyo/file.c:620 tomoyo_find_next_domain+0x38d/0x2010 security/tomoyo/domain.c:763 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:102 [inline] tomoyo_bprm_check_security+0x12d/0x1d0 security/tomoyo/tomoyo.c:92 security_bprm_check+0x87/0x1e0 security/security.c:820 search_binary_handler fs/exec.c:1684 [inline] exec_binprm fs/exec.c:1726 [inline] bprm_execve fs/exec.c:1778 [inline] bprm_execve+0x84b/0x1730 fs/exec.c:1754 do_execveat_common.isra.0+0x4a5/0x580 fs/exec.c:1876 __do_sys_execve fs/exec.c:1949 [inline] __se_sys_execve fs/exec.c:1943 [inline] __x64_sys_execve+0x93/0xd0 fs/exec.c:1943 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 Memory state around the buggy address: ffff88803733cb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803733cb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803733cc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803733cc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803733cd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 20 44 88 74 and %al,0x74(%rax,%rcx,4) 4: 24 1e and $0x1e,%al 6: 45 89 ee mov %r13d,%r14d 9: 48 c7 c7 80 7a ad 8b mov $0xffffffff8bad7a80,%rdi 10: e8 f8 c3 cb 09 call 0x9cbc40d 15: 31 d2 xor %edx,%edx 17: 65 66 89 15 d6 e8 46 mov %dx,%gs:0x1246e8d6(%rip) # 0x1246e8f5 1e: 12 1f: e8 19 bc 49 00 call 0x49bc3d 24: fb sti 25: bb ff ff ff ff mov $0xffffffff,%ebx * 2a: 49 c7 c4 c0 a0 40 8e mov $0xffffffff8e40a0c0,%r12 <-- trapping instruction 31: 41 0f bc de bsf %r14d,%ebx 35: 83 c3 01 add $0x1,%ebx 38: 0f 85 a4 00 00 00 jne 0xe2 3e: e9 .byte 0xe9 3f: 1b .byte 0x1b