================================================================== 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 ffff8880232d9418 by task syz-executor/7838 CPU: 0 UID: 0 PID: 7838 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 __kasan_check_byte+0x36/0x50 mm/kasan/common.c:568 kasan_check_byte include/linux/kasan.h:399 [inline] lock_acquire kernel/locking/lockdep.c:5842 [inline] lock_acquire+0xfc/0x350 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:397 [inline] p9_req_put net/9p/client.c:405 [inline] p9_req_put+0xaf/0x250 net/9p/client.c:402 req_done+0x1dc/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2719 [inline] vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2694 __handle_irq_event_percpu+0x22c/0x7d0 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x3ca/0x9e0 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:254 [inline] call_irq_handler arch/x86/kernel/irq.c:310 [inline] __common_interrupt+0xcd/0x2f0 arch/x86/kernel/irq.c:325 common_interrupt+0x61/0xe0 arch/x86/kernel/irq.c:318 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:handle_softirqs+0x1dd/0x8e0 kernel/softirq.c:565 Code: 88 6c 24 26 4c 89 7c 24 18 48 c7 c7 60 a6 ab 8b e8 38 47 15 0a 65 66 c7 05 c6 32 5a 12 00 00 e8 79 f3 46 00 fb bb ff ff ff ff <49> c7 c7 c0 c0 20 8e 41 0f bc dc 83 c3 01 0f 85 a4 00 00 00 e9 b1 RSP: 0018:ffffc90000007f28 EFLAGS: 00000206 RAX: 000000000003baaa RBX: 00000000ffffffff RCX: ffffffff81c2efef RDX: 0000000000000000 RSI: ffffffff8de4eb79 RDI: ffffffff8c163180 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff90aba197 R11: 0000000000000000 R12: 0000000000000282 R13: 000000000000000a R14: 1ffff92000000fed R15: ffffed1004e0c000 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:finish_task_switch.isra.0+0x22a/0xc10 kernel/sched/core.c:5225 Code: fb 09 00 00 44 8b 05 19 2f 23 0f 45 85 c0 0f 85 be 01 00 00 4c 89 e7 e8 a4 f6 ff ff e8 bf 4c 3a 00 fb 65 48 8b 1d de 8b 4d 12 <48> 8d bb 18 16 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 RSP: 0018:ffffc90003257a18 EFLAGS: 00000206 RAX: 000000000003baa5 RBX: ffff888027060000 RCX: ffffffff81c2efef RDX: 0000000000000000 RSI: ffffffff8de4eb79 RDI: ffffffff8c163180 RBP: ffffc90003257a60 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff90aba197 R11: 0000000000000000 R12: ffff88802b23a440 R13: ffff8880207f4880 R14: ffff88802b23a440 R15: ffff88802b23b2b0 context_switch kernel/sched/core.c:5360 [inline] __schedule+0x1198/0x5de0 kernel/sched/core.c:6961 __schedule_loop kernel/sched/core.c:7043 [inline] schedule+0xe7/0x3a0 kernel/sched/core.c:7058 do_nanosleep+0x21a/0x570 kernel/time/hrtimer.c:2100 hrtimer_nanosleep+0x155/0x380 kernel/time/hrtimer.c:2147 common_nsleep+0xa1/0xd0 kernel/time/posix-timers.c:1353 __do_sys_clock_nanosleep_time32 kernel/time/posix-timers.c:1427 [inline] __se_sys_clock_nanosleep_time32 kernel/time/posix-timers.c:1404 [inline] __ia32_sys_clock_nanosleep_time32+0x33d/0x4f0 kernel/time/posix-timers.c:1404 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf708e579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000ffa5a080 EFLAGS: 00000293 ORIG_RAX: 000000000000010b RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000000000 RDX: 00000000ffa5a0b4 RSI: 00000000ffa5a0ac RDI: 00000000ffa5a0b4 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 8304: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405 kmalloc_noprof include/linux/slab.h:905 [inline] p9_client_create+0xc7/0x11c0 net/9p/client.c:985 v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:666 vfs_get_tree+0x8b/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3808 [inline] path_mount+0x1513/0x2000 fs/namespace.c:4123 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount fs/namespace.c:4324 [inline] __ia32_sys_mount+0x28b/0x310 fs/namespace.c:4324 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 8304: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x60/0x70 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2422 [inline] slab_free mm/slub.c:4695 [inline] kfree+0x2b4/0x4d0 mm/slub.c:4894 p9_client_create+0xa28/0x11c0 net/9p/client.c:1064 v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:666 vfs_get_tree+0x8b/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3808 [inline] path_mount+0x1513/0x2000 fs/namespace.c:4123 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount fs/namespace.c:4324 [inline] __ia32_sys_mount+0x28b/0x310 fs/namespace.c:4324 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff8880232d9400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff8880232d9400, ffff8880232d9600) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x232d8 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b842c80 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842c80 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea00008cb601 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 8094, tgid 8094 (dhcpcd-run-hook), ts 222379020467, free_ts 220745719452 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_slab_page mm/slub.c:2494 [inline] allocate_slab mm/slub.c:2660 [inline] new_slab+0x94/0x330 mm/slub.c:2714 ___slab_alloc+0xcf2/0x1750 mm/slub.c:3901 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992 __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] __do_kmalloc_node mm/slub.c:4375 [inline] __kmalloc_node_noprof+0x2ed/0x500 mm/slub.c:4382 kmalloc_array_node_noprof include/linux/slab.h:1020 [inline] alloc_slab_obj_exts+0x41/0xa0 mm/slub.c:2033 account_slab mm/slub.c:2619 [inline] allocate_slab mm/slub.c:2679 [inline] new_slab+0x27d/0x330 mm/slub.c:2714 ___slab_alloc+0xcf2/0x1750 mm/slub.c:3901 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992 __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] kmem_cache_alloc_noprof+0xef/0x3b0 mm/slub.c:4247 anon_vma_chain_alloc mm/rmap.c:142 [inline] anon_vma_fork+0x200/0x620 mm/rmap.c:364 dup_mmap+0x152e/0x21d0 mm/mmap.c:1797 dup_mm kernel/fork.c:1485 [inline] copy_mm kernel/fork.c:1537 [inline] copy_process+0x4081/0x7690 kernel/fork.c:2175 kernel_clone+0xfc/0x930 kernel/fork.c:2605 page last free pid 5972 tgid 5972 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895 discard_slab mm/slub.c:2758 [inline] __put_partials+0x165/0x1c0 mm/slub.c:3223 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4191 [inline] slab_alloc_node mm/slub.c:4240 [inline] kmem_cache_alloc_noprof+0x1cb/0x3b0 mm/slub.c:4247 getname_flags.part.0+0x4c/0x550 fs/namei.c:146 getname_flags+0x93/0xf0 include/linux/audit.h:322 user_path_at+0x24/0x60 fs/namei.c:3126 ksys_umount fs/namespace.c:2112 [inline] __do_sys_umount fs/namespace.c:2120 [inline] __se_sys_umount fs/namespace.c:2118 [inline] __ia32_sys_umount+0x109/0x190 fs/namespace.c:2118 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff8880232d9300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880232d9380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880232d9400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880232d9480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880232d9500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 88 6c 24 26 mov %ch,0x26(%rsp) 4: 4c 89 7c 24 18 mov %r15,0x18(%rsp) 9: 48 c7 c7 60 a6 ab 8b mov $0xffffffff8baba660,%rdi 10: e8 38 47 15 0a call 0xa15474d 15: 65 66 c7 05 c6 32 5a movw $0x0,%gs:0x125a32c6(%rip) # 0x125a32e5 1c: 12 00 00 1f: e8 79 f3 46 00 call 0x46f39d 24: fb sti 25: bb ff ff ff ff mov $0xffffffff,%ebx * 2a: 49 c7 c7 c0 c0 20 8e mov $0xffffffff8e20c0c0,%r15 <-- trapping instruction 31: 41 0f bc dc bsf %r12d,%ebx 35: 83 c3 01 add $0x1,%ebx 38: 0f 85 a4 00 00 00 jne 0xe2 3e: e9 .byte 0xe9 3f: b1 .byte 0xb1