================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:220 [inline] BUG: KASAN: use-after-free in __refcount_sub_and_test include/linux/refcount.h:272 [inline] BUG: KASAN: use-after-free in refcount_sub_and_test include/linux/refcount.h:310 [inline] BUG: KASAN: use-after-free in io_put_req_deferred fs/io_uring.c:2248 [inline] BUG: KASAN: use-after-free in io_link_timeout_fn+0x3b1/0x610 fs/io_uring.c:6266 Write of size 4 at addr ffff888046008a5c by task syz-executor.1/20384 CPU: 1 PID: 20384 Comm: syz-executor.1 Not tainted 5.10.52 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0+0x1c/0x210 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x37/0x7c mm/kasan/report.c:562 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0xf9/0x1e0 mm/kasan/generic.c:192 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:220 [inline] __refcount_sub_and_test include/linux/refcount.h:272 [inline] refcount_sub_and_test include/linux/refcount.h:310 [inline] io_put_req_deferred fs/io_uring.c:2248 [inline] io_link_timeout_fn+0x3b1/0x610 fs/io_uring.c:6266 __run_hrtimer kernel/time/hrtimer.c:1537 [inline] __hrtimer_run_queues+0x5e8/0xb50 kernel/time/hrtimer.c:1601 hrtimer_interrupt+0x2fd/0x9b0 kernel/time/hrtimer.c:1663 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1084 [inline] __sysvec_apic_timer_interrupt+0xfb/0x400 arch/x86/kernel/apic/apic.c:1101 asm_call_irq_on_stack+0x12/0x20 __run_sysvec_on_irqstack arch/x86/include/asm/irq_stack.h:37 [inline] run_sysvec_on_irqstack_cond arch/x86/include/asm/irq_stack.h:89 [inline] sysvec_apic_timer_interrupt+0x7f/0xa0 arch/x86/kernel/apic/apic.c:1095 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:635 RIP: 0010:zap_pte_range mm/memory.c:1265 [inline] RIP: 0010:zap_pmd_range mm/memory.c:1379 [inline] RIP: 0010:zap_pud_range mm/memory.c:1408 [inline] RIP: 0010:zap_p4d_range mm/memory.c:1429 [inline] RIP: 0010:unmap_page_range+0xe8b/0x1e30 mm/memory.c:1450 Code: 48 c1 eb 10 83 e3 01 89 de e8 81 4e e1 ff 84 db 0f 84 f9 03 00 00 e8 44 55 e1 ff 48 89 ef e8 ac 5b fb ff 89 c3 e8 35 55 e1 ff <31> ff 89 de e8 9c 4e e1 ff 85 db 0f 88 22 08 00 00 e8 1f 55 e1 ff RSP: 0018:ffff88805c0df770 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 000000000000003a RCX: ffffffff815e3425 RDX: ffff888046b96500 RSI: ffffffff815e2ffb RDI: ffffea0000d0dbf0 RBP: ffffea0000d0dbc0 R08: 0000000000000000 R09: ffffea0000d0dbf3 R10: fffff940001a1b7e R11: 0000000000000001 R12: ffffea0000d0dbf0 R13: 00007faeedf39000 R14: dffffc0000000000 R15: ffff888062c8e9c0 unmap_single_vma+0x198/0x300 mm/memory.c:1495 unmap_vmas+0x16d/0x2f0 mm/memory.c:1527 exit_mmap+0x27f/0x4e0 mm/mmap.c:3220 __mmput kernel/fork.c:1088 [inline] mmput+0xca/0x340 kernel/fork.c:1109 exit_mm kernel/exit.c:487 [inline] do_exit+0xb42/0x2770 kernel/exit.c:798 do_group_exit+0x125/0x310 kernel/exit.c:908 get_signal+0x469/0x2200 kernel/signal.c:2758 arch_do_signal+0x88/0x1b70 arch/x86/kernel/signal.c:805 exit_to_user_mode_loop kernel/entry/common.c:161 [inline] exit_to_user_mode_prepare+0xf7/0x160 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x38/0x230 kernel/entry/common.c:266 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x466609 Code: Unable to access opcode bytes at RIP 0x4665df. RSP: 002b:00007faeebf02218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000000 RBX: 000000000056bf88 RCX: 0000000000466609 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000056bf88 RBP: 000000000056bf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf8c R13: 00007ffd2fca41af R14: 00007faeebf02300 R15: 0000000000022000 Allocated by task 20384: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 slab_post_alloc_hook mm/slab.h:532 [inline] kmem_cache_alloc_bulk+0x147/0x320 mm/slub.c:3334 io_alloc_req fs/io_uring.c:1854 [inline] io_submit_sqes+0x11c2/0x2310 fs/io_uring.c:6680 __do_sys_io_uring_enter+0x1092/0x1910 fs/io_uring.c:9092 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 20384: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0x110/0x150 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1542 [inline] slab_free_freelist_hook+0x64/0x150 mm/slub.c:1575 slab_free mm/slub.c:3140 [inline] kmem_cache_free+0x97/0x2f0 mm/slub.c:3156 __io_free_req+0x216/0x310 fs/io_uring.c:1909 io_free_req fs/io_uring.c:2132 [inline] io_double_put_req fs/io_uring.c:2272 [inline] io_put_req+0xab/0x100 fs/io_uring.c:2268 io_link_timeout_fn+0x33c/0x610 fs/io_uring.c:6261 __run_hrtimer kernel/time/hrtimer.c:1537 [inline] __hrtimer_run_queues+0x5e8/0xb50 kernel/time/hrtimer.c:1601 hrtimer_interrupt+0x2fd/0x9b0 kernel/time/hrtimer.c:1663 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1084 [inline] __sysvec_apic_timer_interrupt+0xfb/0x400 arch/x86/kernel/apic/apic.c:1101 asm_call_irq_on_stack+0x12/0x20 __run_sysvec_on_irqstack arch/x86/include/asm/irq_stack.h:37 [inline] run_sysvec_on_irqstack_cond arch/x86/include/asm/irq_stack.h:89 [inline] sysvec_apic_timer_interrupt+0x7f/0xa0 arch/x86/kernel/apic/apic.c:1095 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:635 The buggy address belongs to the object at ffff888046008a00 which belongs to the cache io_kiocb of size 216 The buggy address is located 92 bytes inside of 216-byte region [ffff888046008a00, ffff888046008ad8) The buggy address belongs to the page: page:000000005c209df1 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x46008 flags: 0x100000000000200(slab) raw: 0100000000000200 ffffea00014e0480 0000000b0000000b ffff88800c0ff000 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888046008900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888046008980: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888046008a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888046008a80: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff888046008b00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 1 PID: 20384 at lib/refcount.c:28 refcount_warn_saturate+0x103/0x1f0 lib/refcount.c:28 Modules linked in: CPU: 1 PID: 20384 Comm: syz-executor.1 Tainted: G B 5.10.52 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:refcount_warn_saturate+0x103/0x1f0 lib/refcount.c:28 Code: 1d d2 63 54 03 31 ff 89 de e8 c9 22 51 ff 84 db 75 a3 e8 90 29 51 ff 48 c7 c7 20 38 3b 84 c6 05 b2 63 54 03 01 e8 cc 0c c9 01 <0f> 0b eb 87 e8 74 29 51 ff 0f b6 1d 9b 63 54 03 31 ff 89 de e8 94 RSP: 0018:ffff88806cf09d30 EFLAGS: 00010082 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888046b96500 RSI: ffffffff81293053 RDI: ffffed100d9e1398 RBP: ffff888046008a5c R08: 0000000000000001 R09: ffff88806cf1ff9b R10: 0000000000000000 R11: 0000000000000001 R12: ffff888046008a5c R13: 0000000000000001 R14: ffff88803c9a44c0 R15: ffff888053812780 FS: 0000000000000000(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000002a8bb38 CR3: 0000000040278000 CR4: 0000000000350ee0 Call Trace: __refcount_sub_and_test include/linux/refcount.h:283 [inline] refcount_sub_and_test include/linux/refcount.h:310 [inline] io_put_req_deferred fs/io_uring.c:2248 [inline] io_link_timeout_fn+0x503/0x610 fs/io_uring.c:6266 __run_hrtimer kernel/time/hrtimer.c:1537 [inline] __hrtimer_run_queues+0x5e8/0xb50 kernel/time/hrtimer.c:1601 hrtimer_interrupt+0x2fd/0x9b0 kernel/time/hrtimer.c:1663 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1084 [inline] __sysvec_apic_timer_interrupt+0xfb/0x400 arch/x86/kernel/apic/apic.c:1101 asm_call_irq_on_stack+0x12/0x20 __run_sysvec_on_irqstack arch/x86/include/asm/irq_stack.h:37 [inline] run_sysvec_on_irqstack_cond arch/x86/include/asm/irq_stack.h:89 [inline] sysvec_apic_timer_interrupt+0x7f/0xa0 arch/x86/kernel/apic/apic.c:1095 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:635 RIP: 0010:zap_pte_range mm/memory.c:1265 [inline] RIP: 0010:zap_pmd_range mm/memory.c:1379 [inline] RIP: 0010:zap_pud_range mm/memory.c:1408 [inline] RIP: 0010:zap_p4d_range mm/memory.c:1429 [inline] RIP: 0010:unmap_page_range+0xe8b/0x1e30 mm/memory.c:1450 Code: 48 c1 eb 10 83 e3 01 89 de e8 81 4e e1 ff 84 db 0f 84 f9 03 00 00 e8 44 55 e1 ff 48 89 ef e8 ac 5b fb ff 89 c3 e8 35 55 e1 ff <31> ff 89 de e8 9c 4e e1 ff 85 db 0f 88 22 08 00 00 e8 1f 55 e1 ff RSP: 0018:ffff88805c0df770 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 000000000000003a RCX: ffffffff815e3425 RDX: ffff888046b96500 RSI: ffffffff815e2ffb RDI: ffffea0000d0dbf0 RBP: ffffea0000d0dbc0 R08: 0000000000000000 R09: ffffea0000d0dbf3 R10: fffff940001a1b7e R11: 0000000000000001 R12: ffffea0000d0dbf0 R13: 00007faeedf39000 R14: dffffc0000000000 R15: ffff888062c8e9c0 unmap_single_vma+0x198/0x300 mm/memory.c:1495 unmap_vmas+0x16d/0x2f0 mm/memory.c:1527 exit_mmap+0x27f/0x4e0 mm/mmap.c:3220 __mmput kernel/fork.c:1088 [inline] mmput+0xca/0x340 kernel/fork.c:1109 exit_mm kernel/exit.c:487 [inline] do_exit+0xb42/0x2770 kernel/exit.c:798 do_group_exit+0x125/0x310 kernel/exit.c:908 get_signal+0x469/0x2200 kernel/signal.c:2758 arch_do_signal+0x88/0x1b70 arch/x86/kernel/signal.c:805 exit_to_user_mode_loop kernel/entry/common.c:161 [inline] exit_to_user_mode_prepare+0xf7/0x160 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x38/0x230 kernel/entry/common.c:266 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x466609 Code: Unable to access opcode bytes at RIP 0x4665df. RSP: 002b:00007faeebf02218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000000 RBX: 000000000056bf88 RCX: 0000000000466609 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000056bf88 RBP: 000000000056bf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf8c R13: 00007ffd2fca41af R14: 00007faeebf02300 R15: 0000000000022000 irq event stamp: 2138 hardirqs last enabled at (2137): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (2137): [] _raw_spin_unlock_irq+0x1f/0x30 kernel/locking/spinlock.c:199 hardirqs last disabled at (2138): [] sysvec_apic_timer_interrupt+0xb/0xa0 arch/x86/kernel/apic/apic.c:1095 softirqs last enabled at (2088): [] asm_call_irq_on_stack+0x12/0x20 softirqs last disabled at (2083): [] asm_call_irq_on_stack+0x12/0x20 ---[ end trace a765c30b054b5fe1 ]--- tmpfs: Bad value for 'gid' tmpfs: Bad value for 'gid'