================================================================== 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 ffff888037399004 by task udevd/5143 CPU: 3 UID: 0 PID: 5143 Comm: udevd 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 18 f4 ce 09 31 d2 65 66 89 15 d6 b8 48 12 e8 39 c6 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: ffffffff8211ac5f RDX: 0000000000000000 RSI: ffffffff8c1e6100 RDI: ffffffff81c7e767 RBP: 00000001000034b7 R08: 0000000000000000 R09: fffffbfff21b45d2 R10: 0000000000000000 R11: ffffc900006f8ff8 R12: 000000000000000a R13: 0000000000000004 R14: 0000000000000004 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:__sanitizer_cov_trace_pc+0x2a/0x70 kernel/kcov.c:235 Code: f3 0f 1e fa 65 8b 05 05 41 07 12 48 8b 34 24 65 48 8b 15 e1 40 07 12 a9 00 01 ff 00 74 1b f6 c4 01 74 07 a9 00 00 ff 00 74 05 51 a2 90 09 8b 82 24 17 00 00 85 c0 74 f1 8b 82 f8 16 00 00 83 RSP: 0018:ffffc900035474b0 EFLAGS: 00000293 RAX: 0000000000000000 RBX: ffff888026642988 RCX: ffffc900035477d8 RDX: ffff88802b8a0000 RSI: ffffffff84b9bccb RDI: ffff888026642988 RBP: ffffc90003547640 R08: 0000000000000002 R09: 000000000000041d R10: 0000000000000409 R11: 0000000000000001 R12: ffffc90003547948 R13: 0000000000000600 R14: ffffc90003547948 R15: ffffc90003547640 avtab_search_node+0x2b/0x490 security/selinux/ss/avtab.c:151 cond_compute_av+0x5f/0x350 security/selinux/ss/conditional.c:591 context_struct_compute_av+0x81f/0x1250 security/selinux/ss/services.c:677 security_compute_av+0x5ea/0x11e0 security/selinux/ss/services.c:1178 avc_compute_av+0x84/0x820 security/selinux/avc.c:992 avc_perm_nonode+0xb1/0x180 security/selinux/avc.c:1117 avc_has_perm_noaudit+0x2d4/0x3b0 security/selinux/avc.c:1160 selinux_inode_permission+0x8d4/0x1130 security/selinux/hooks.c:3280 security_inode_permission+0xda/0x250 security/security.c:1842 inode_permission+0x36c/0x620 fs/namei.c:661 may_open+0x2b8/0x480 fs/namei.c:4274 do_open fs/namei.c:4698 [inline] path_openat+0x8da/0x4280 fs/namei.c:4859 do_file_open+0x20e/0x430 fs/namei.c:4888 do_sys_openat2+0x10f/0x1e0 fs/open.c:1395 do_sys_open fs/open.c:1401 [inline] __do_sys_openat fs/open.c:1417 [inline] __se_sys_openat fs/open.c:1412 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1412 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:0x7f6e8aea7407 Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007ffc0beee160 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f6e8b580880 RCX: 00007f6e8aea7407 RDX: 0000000000080141 RSI: 0000564328c8602e RDI: ffffffffffffff9c RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000001a4 R11: 0000000000000202 R12: 00000000ffffffff R13: 00000000ffffffff R14: ffffffffffffffff R15: 00007ffc0beee480 Allocated by task 24042: 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:864 v9fs_session_init+0x3c/0xdd0 fs/9p/v9fs.c:471 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 24042: 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:943 v9fs_session_init+0x3c/0xdd0 fs/9p/v9fs.c:471 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 ffff888037399000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 4 bytes inside of freed 512-byte region [ffff888037399000, ffff888037399200) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x37398 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 22693, tgid 22693 (syz-executor), ts 414022627116, free_ts 413307180413 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 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] device_private_init drivers/base/core.c:3602 [inline] device_add+0xd3f/0x1970 drivers/base/core.c:3653 netdev_register_kobject+0x1a9/0x3d0 net/core/net-sysfs.c:2337 register_netdevice+0x15b6/0x25a0 net/core/dev.c:11439 virt_wifi_newlink+0x3ec/0x840 drivers/net/wireless/virtual/virt_wifi.c:572 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 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1900 page last free pid 5827 tgid 5827 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950 kasan_depopulate_vmalloc_pte+0x5d/0x80 mm/kasan/shadow.c:484 apply_to_pte_range mm/memory.c:3338 [inline] apply_to_pmd_range mm/memory.c:3382 [inline] apply_to_pud_range mm/memory.c:3418 [inline] apply_to_p4d_range mm/memory.c:3454 [inline] __apply_to_page_range+0xb1d/0x1520 mm/memory.c:3490 __kasan_release_vmalloc+0xd7/0xe0 mm/kasan/shadow.c:602 kasan_release_vmalloc include/linux/kasan.h:593 [inline] kasan_release_vmalloc_node mm/vmalloc.c:2284 [inline] purge_vmap_node+0x210/0xb40 mm/vmalloc.c:2306 __purge_vmap_area_lazy+0x90a/0xc00 mm/vmalloc.c:2396 drain_vmap_area_work+0x27/0x40 mm/vmalloc.c:2430 process_one_work+0xa23/0x1940 kernel/workqueue.c:3322 process_scheduled_works kernel/workqueue.c:3405 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486 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: ffff888037398f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888037398f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888037399000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888037399080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888037399100: 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 18 f4 ce 09 call 0x9cef42d 15: 31 d2 xor %edx,%edx 17: 65 66 89 15 d6 b8 48 mov %dx,%gs:0x1248b8d6(%rip) # 0x1248b8f5 1e: 12 1f: e8 39 c6 49 00 call 0x49c65d 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