================================================================== 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/linux/atomic/atomic-instrumented.h:167 [inline] BUG: KASAN: use-after-free in __refcount_sub_and_test include/linux/refcount.h:272 [inline] BUG: KASAN: use-after-free in __refcount_dec_and_test include/linux/refcount.h:315 [inline] BUG: KASAN: use-after-free in refcount_dec_and_test include/linux/refcount.h:333 [inline] BUG: KASAN: use-after-free in iocb_put fs/aio.c:1162 [inline] BUG: KASAN: use-after-free in io_submit_one+0x6fb/0x1b80 fs/aio.c:1883 Write of size 4 at addr ffff88806e54c208 by task syz-executor.2/11077 CPU: 3 PID: 11077 Comm: syz-executor.2 Not tainted 5.15.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:167 [inline] __refcount_sub_and_test include/linux/refcount.h:272 [inline] __refcount_dec_and_test include/linux/refcount.h:315 [inline] refcount_dec_and_test include/linux/refcount.h:333 [inline] iocb_put fs/aio.c:1162 [inline] io_submit_one+0x6fb/0x1b80 fs/aio.c:1883 __do_compat_sys_io_submit fs/aio.c:1981 [inline] __se_compat_sys_io_submit fs/aio.c:1951 [inline] __ia32_compat_sys_io_submit+0x197/0x390 fs/aio.c:1951 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf6ed7549 Code: 03 74 c0 01 10 05 03 74 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 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:00000000f44d15fc EFLAGS: 00000296 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00000000f7018000 RCX: 0000000000000004 RDX: 00000000200000c0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 11077: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x83/0xb0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3213 [inline] slab_alloc mm/slub.c:3221 [inline] kmem_cache_alloc+0x209/0x390 mm/slub.c:3226 aio_get_req fs/aio.c:1029 [inline] io_submit_one+0xfd/0x1b80 fs/aio.c:1876 __do_compat_sys_io_submit fs/aio.c:1981 [inline] __se_compat_sys_io_submit fs/aio.c:1951 [inline] __ia32_compat_sys_io_submit+0x197/0x390 fs/aio.c:1951 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Freed by task 11077: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1726 slab_free mm/slub.c:3492 [inline] kmem_cache_free+0x95/0x5d0 mm/slub.c:3508 iocb_destroy fs/aio.c:1081 [inline] iocb_put fs/aio.c:1164 [inline] iocb_put fs/aio.c:1160 [inline] aio_complete_rw+0x474/0x8c0 fs/aio.c:1441 aio_rw_done fs/aio.c:1511 [inline] aio_write+0x3b2/0x7a0 fs/aio.c:1578 __io_submit_one fs/aio.c:1833 [inline] io_submit_one+0xe09/0x1b80 fs/aio.c:1880 __do_compat_sys_io_submit fs/aio.c:1981 [inline] __se_compat_sys_io_submit fs/aio.c:1951 [inline] __ia32_compat_sys_io_submit+0x197/0x390 fs/aio.c:1951 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c The buggy address belongs to the object at ffff88806e54c140 which belongs to the cache aio_kiocb of size 216 The buggy address is located 200 bytes inside of 216-byte region [ffff88806e54c140, ffff88806e54c218) The buggy address belongs to the page: page:ffffea0001b95300 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88806e54c000 pfn:0x6e54c head:ffffea0001b95300 order:1 compound_mapcount:0 flags: 0x4fff00000010200(slab|head|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000010200 0000000000000000 dead000000000122 ffff888042a01e00 raw: ffff88806e54c000 0000000080190018 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 9946, ts 353769155208, free_ts 347987894443 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4155 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5381 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1770 [inline] allocate_slab mm/slub.c:1907 [inline] new_slab+0x319/0x490 mm/slub.c:1970 ___slab_alloc+0x921/0xfe0 mm/slub.c:3001 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3088 slab_alloc_node mm/slub.c:3179 [inline] slab_alloc mm/slub.c:3221 [inline] kmem_cache_alloc+0x363/0x390 mm/slub.c:3226 aio_get_req fs/aio.c:1029 [inline] io_submit_one+0xfd/0x1b80 fs/aio.c:1876 __do_compat_sys_io_submit fs/aio.c:1981 [inline] __se_compat_sys_io_submit fs/aio.c:1951 [inline] __ia32_compat_sys_io_submit+0x197/0x390 fs/aio.c:1951 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare+0x326/0x810 mm/page_alloc.c:1391 free_unref_page_prepare mm/page_alloc.c:3317 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3396 __put_single_page mm/swap.c:99 [inline] __put_page+0x13d/0x470 mm/swap.c:130 folio_put include/linux/mm.h:1269 [inline] put_page include/linux/mm.h:1287 [inline] free_page_and_swap_cache+0x1f2/0x270 mm/swap_state.c:305 __tlb_remove_table arch/x86/include/asm/tlb.h:37 [inline] __tlb_remove_table_free mm/mmu_gather.c:101 [inline] tlb_remove_table_rcu+0x85/0xe0 mm/mmu_gather.c:156 rcu_do_batch kernel/rcu/tree.c:2508 [inline] rcu_core+0x7ab/0x1470 kernel/rcu/tree.c:2743 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 run_ksoftirqd kernel/softirq.c:920 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:912 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88806e54c100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88806e54c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806e54c200: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88806e54c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88806e54c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 03 74 c0 01 add 0x1(%rax,%rax,8),%esi 4: 10 05 03 74 b8 01 adc %al,0x1b87403(%rip) # 0x1b8740d a: 10 06 adc %al,(%rsi) c: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 10: 10 07 adc %al,(%rdi) 12: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi 16: 10 08 adc %cl,(%rax) 18: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1c: 00 00 add %al,(%rax) 1e: 00 00 add %al,(%rax) 20: 00 51 52 add %dl,0x52(%rcx) 23: 55 push %rbp 24: 89 e5 mov %esp,%ebp 26: 0f 34 sysenter 28: cd 80 int $0x80 * 2a: 5d pop %rbp <-- trapping instruction 2b: 5a pop %rdx 2c: 59 pop %rcx 2d: c3 retq 2e: 90 nop 2f: 90 nop 30: 90 nop 31: 90 nop 32: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 39: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi