================================================================== BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181 Read of size 1 at addr ffff88803733a818 by task kworker/3:4/5885 CPU: 3 UID: 0 PID: 5885 Comm: kworker/3:4 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 Workqueue: usb_hub_wq hub_event 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 __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:5860 [inline] lock_acquire+0x132/0x370 kernel/locking/lockdep.c:5843 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181 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:3305 __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+0x1a9/0x9d0 kernel/softirq.c:631 Code: 89 6c 24 28 4c 89 7c 24 10 48 c7 c7 a0 7c ed 8b e8 dc b0 fd 09 31 d2 65 66 89 15 5e 97 be 12 e8 7d 06 4a 00 fb bb ff ff ff ff <48> c7 c5 c0 a0 a0 8e 41 0f bc dc 83 c3 01 0f 85 9d 00 00 00 e9 b9 RSP: 0018:ffffc900006f8f20 EFLAGS: 00000206 RAX: 0000000000031796 RBX: 00000000ffffffff RCX: 0000000000000004 RDX: 0000000000000101 RSI: ffffffff8e3d3fc0 RDI: ffffffff8c615f80 RBP: 1ffff920000df1ec R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000202 R13: 000000000000000a R14: 00000000fffffd82 R15: fffffbfff1d41e50 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0x194/0x210 kernel/softirq.c:767 irq_exit_rcu+0x9/0x30 kernel/softirq.c:784 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:finish_task_switch.isra.0+0x2ca/0x10d0 kernel/sched/core.c:5371 Code: b6 0a 00 00 41 c7 87 20 0e 00 00 00 00 00 00 0f 1f 44 00 00 49 8d 7f 48 e8 43 75 f3 09 e8 be eb 3c 00 fb 48 8d bb 08 17 00 00 <48> b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 04 02 84 RSP: 0018:ffffc900046b6e78 EFLAGS: 00000206 RAX: 0000000000031793 RBX: ffff88802c0f2580 RCX: 0000000000000040 RDX: 0000000000000001 RSI: ffffffff8e3d3fc0 RDI: ffff88802c0f3c88 RBP: ffffc900046b6ed0 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff888026f68000 R13: 0000000000000000 R14: ffffffff91438a84 R15: ffff88806a73b900 context_switch kernel/sched/core.c:5523 [inline] __schedule+0x1261/0x6920 kernel/sched/core.c:7270 preempt_schedule_notrace+0x57/0xd0 kernel/sched/core.c:7542 preempt_schedule_notrace_thunk+0x16/0x30 arch/x86/entry/thunk.S:13 rcu_is_watching+0x90/0xc0 kernel/rcu/tree.c:753 rcu_read_lock_held_common kernel/rcu/update.c:109 [inline] rcu_read_lock_held+0x1e/0x50 kernel/rcu/update.c:349 kernfs_root+0x20e/0x2a0 fs/kernfs/kernfs-internal.h:77 kernfs_activate_one+0x1f8/0x290 fs/kernfs/dir.c:1431 kernfs_activate fs/kernfs/dir.c:1466 [inline] kernfs_add_one+0x5ec/0xaa0 fs/kernfs/dir.c:868 __kernfs_create_file+0x295/0x350 fs/kernfs/file.c:1079 sysfs_add_file_mode_ns+0x207/0x3c0 fs/sysfs/file.c:316 create_files fs/sysfs/group.c:82 [inline] internal_create_group+0x593/0xfb0 fs/sysfs/group.c:189 internal_create_groups+0x9d/0x150 fs/sysfs/group.c:229 device_add_groups drivers/base/core.c:2911 [inline] device_add_attrs drivers/base/core.c:2986 [inline] device_add+0x7c8/0x1970 drivers/base/core.c:3715 usb_set_configuration+0xd97/0x1c60 drivers/usb/core/message.c:2268 usb_generic_driver_probe+0xa1/0xe0 drivers/usb/core/generic.c:250 usb_probe_device+0xef/0x400 drivers/usb/core/driver.c:291 call_driver_probe drivers/base/dd.c:628 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:706 __driver_probe_device+0x210/0x460 drivers/base/dd.c:868 driver_probe_device+0x4a/0x140 drivers/base/dd.c:898 __device_attach_driver+0x1df/0x320 drivers/base/dd.c:1026 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500 __device_attach+0x1e4/0x4d0 drivers/base/dd.c:1098 device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1153 bus_probe_device+0x64/0x160 drivers/base/bus.c:620 device_add+0x121d/0x1970 drivers/base/core.c:3776 usb_new_device.part.0+0xcc2/0x1686 drivers/usb/core/hub.c:2703 usb_new_device include/linux/workqueue.h:714 [inline] hub_port_connect drivers/usb/core/hub.c:5575 [inline] hub_port_connect_change drivers/usb/core/hub.c:5715 [inline] port_event drivers/usb/core/hub.c:5879 [inline] hub_event.cold+0x1e3/0xe90 drivers/usb/core/hub.c:5961 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3387 process_scheduled_works kernel/workqueue.c:3470 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3551 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 9225: 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 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x2e7/0x6b0 mm/slub.c:5484 _kmalloc_noprof include/linux/slab.h:988 [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:1947 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3772 [inline] do_new_mount fs/namespace.c:3848 [inline] path_mount+0x7d0/0x24c0 fs/namespace.c:4168 do_mount fs/namespace.c:4181 [inline] __do_sys_mount fs/namespace.c:4397 [inline] __se_sys_mount fs/namespace.c:4374 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4374 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 9225: 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:2678 [inline] slab_free mm/slub.c:6372 [inline] kfree+0x22b/0x6c0 mm/slub.c:6687 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:1947 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3772 [inline] do_new_mount fs/namespace.c:3848 [inline] path_mount+0x7d0/0x24c0 fs/namespace.c:4168 do_mount fs/namespace.c:4181 [inline] __do_sys_mount fs/namespace.c:4397 [inline] __se_sys_mount fs/namespace.c:4374 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4374 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803733a800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88803733a800, ffff88803733aa00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x37338 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 ffff88801c042c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801c042c80 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5437, tgid 5437 (dhcpcd), ts 75351893662 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x110d/0x35b0 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3267 [inline] allocate_slab mm/slub.c:3382 [inline] new_slab+0xa5/0x640 mm/slub.c:3428 refill_objects+0xe3/0x410 mm/slub.c:7305 refill_sheaf mm/slub.c:2805 [inline] __pcs_replace_empty_main+0x372/0x680 mm/slub.c:4677 alloc_from_pcs mm/slub.c:4775 [inline] slab_alloc_node mm/slub.c:4907 [inline] __do_kmalloc_node mm/slub.c:5336 [inline] __kmalloc_noprof+0x66b/0x820 mm/slub.c:5362 _kmalloc_noprof include/linux/slab.h:992 [inline] _kzalloc_noprof include/linux/slab.h:1309 [inline] tomoyo_init_log+0x1224/0x20c0 security/tomoyo/audit.c:273 tomoyo_supervisor+0x506/0x1340 security/tomoyo/common.c:2232 tomoyo_audit_path_number_log security/tomoyo/file.c:239 [inline] tomoyo_path_number_perm+0x445/0x580 security/tomoyo/file.c:739 tomoyo_path_mknod+0x164/0x190 security/tomoyo/tomoyo.c:252 security_path_mknod+0x161/0x300 security/security.c:1417 unix_bind_bsd net/unix/af_unix.c:1389 [inline] unix_bind+0x311/0x1650 net/unix/af_unix.c:1484 __sys_bind_socket net/socket.c:1945 [inline] __sys_bind_socket net/socket.c:1937 [inline] __sys_bind+0x1a9/0x260 net/socket.c:1976 __do_sys_bind net/socket.c:1981 [inline] __se_sys_bind net/socket.c:1979 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1979 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 page last free pid 5432 tgid 5432 ts 75264952328 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962 stack_depot_save_flags+0x456/0x9f0 lib/stackdepot.c:735 kasan_save_stack+0x3f/0x50 mm/kasan/common.c:58 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4586 [inline] slab_alloc_node mm/slub.c:4919 [inline] kmem_cache_alloc_lru_noprof+0x267/0x6a0 mm/slub.c:4952 proc_alloc_inode+0x25/0x200 fs/proc/inode.c:57 alloc_inode+0x68/0x250 fs/inode.c:338 new_inode+0x22/0x1c0 fs/inode.c:1171 proc_pid_make_inode+0x22/0x160 fs/proc/base.c:1932 proc_pident_instantiate+0x85/0x310 fs/proc/base.c:2667 proc_pident_lookup+0x1e3/0x270 fs/proc/base.c:2702 __lookup_slow+0x155/0x320 fs/namei.c:1919 lookup_slow+0x50/0x70 fs/namei.c:1936 walk_component fs/namei.c:2282 [inline] lookup_last fs/namei.c:2789 [inline] path_lookupat+0x5e8/0xc40 fs/namei.c:2813 filename_lookup+0x202/0x590 fs/namei.c:2842 Memory state around the buggy address: ffff88803733a700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803733a780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803733a800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803733a880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803733a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 89 6c 24 28 mov %ebp,0x28(%rsp) 4: 4c 89 7c 24 10 mov %r15,0x10(%rsp) 9: 48 c7 c7 a0 7c ed 8b mov $0xffffffff8bed7ca0,%rdi 10: e8 dc b0 fd 09 call 0x9fdb0f1 15: 31 d2 xor %edx,%edx 17: 65 66 89 15 5e 97 be mov %dx,%gs:0x12be975e(%rip) # 0x12be977d 1e: 12 1f: e8 7d 06 4a 00 call 0x4a06a1 24: fb sti 25: bb ff ff ff ff mov $0xffffffff,%ebx * 2a: 48 c7 c5 c0 a0 a0 8e mov $0xffffffff8ea0a0c0,%rbp <-- trapping instruction 31: 41 0f bc dc bsf %r12d,%ebx 35: 83 c3 01 add $0x1,%ebx 38: 0f 85 9d 00 00 00 jne 0xdb 3e: e9 .byte 0xe9 3f: b9 .byte 0xb9