================================================================== BUG: KASAN: out-of-bounds in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: out-of-bounds in atomic_dec include/linux/atomic/atomic-instrumented.h:592 [inline] BUG: KASAN: out-of-bounds in put_bh include/linux/buffer_head.h:302 [inline] BUG: KASAN: out-of-bounds in end_buffer_read_sync+0xc1/0xd0 fs/buffer.c:161 Write of size 4 at addr ffffc9000bfef660 by task syz.4.2173/10453 CPU: 0 UID: 0 PID: 10453 Comm: syz.4.2173 Not tainted 6.13.0-rc4-syzkaller-00054-gd6ef8b40d075 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_dec include/linux/atomic/atomic-instrumented.h:592 [inline] put_bh include/linux/buffer_head.h:302 [inline] end_buffer_read_sync+0xc1/0xd0 fs/buffer.c:161 end_bio_bh_io_sync+0xc1/0x120 fs/buffer.c:2766 blk_update_request+0x5e5/0x1160 block/blk-mq.c:981 blk_mq_end_request+0x3e/0x70 block/blk-mq.c:1143 blk_complete_reqs block/blk-mq.c:1218 [inline] blk_done_softirq+0x102/0x150 block/blk-mq.c:1223 handle_softirqs+0x2d6/0x9b0 kernel/softirq.c:561 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:in_lock_functions+0x0/0x30 kernel/locking/spinlock.c:408 Code: c1 0f 8c 73 ff ff ff 48 c7 c7 00 4e 2e 96 e8 a7 d8 89 00 e9 62 ff ff ff 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1e fa 48 c7 c0 20 66 cb 8b 48 39 c7 0f 93 c0 48 c7 c1 0a a0 RSP: 0018:ffffc9000333f788 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 0000000000000001 RCX: ffffffff8bcba001 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc9000333f8f0 R08: ffffffff81e2d029 R09: 1ffff1100bac3e21 R10: dffffc0000000000 R11: ffffed100bac3e22 R12: ffffea0001542b00 R13: 0000000000000001 R14: 0000000000000000 R15: dffffc0000000000 get_lock_parent_ip include/linux/ftrace.h:1002 [inline] preempt_latency_start kernel/sched/core.c:5829 [inline] preempt_count_add+0xa1/0x190 kernel/sched/core.c:5854 __raw_spin_lock include/linux/spinlock_api_smp.h:132 [inline] _raw_spin_lock+0x12/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] shmem_recalc_inode mm/shmem.c:442 [inline] shmem_alloc_and_add_folio+0xca8/0x1080 mm/shmem.c:1895 shmem_get_folio_gfp+0x621/0x1840 mm/shmem.c:2357 shmem_get_folio mm/shmem.c:2463 [inline] shmem_write_begin+0x165/0x350 mm/shmem.c:3119 generic_perform_write+0x348/0x990 mm/filemap.c:4055 shmem_file_write_iter+0xf9/0x120 mm/shmem.c:3295 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xaed/0xd30 fs/read_write.c:679 ksys_write+0x18f/0x2b0 fs/read_write.c:731 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6011f847df Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 f9 92 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 4c 93 02 00 48 RSP: 002b:00007f6012cd6df0 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000200000 RCX: 00007f6011f847df RDX: 0000000000200000 RSI: 00007f6008c00000 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 000000000001f812 R10: 0000000000003ffc R11: 0000000000000293 R12: 0000000000000003 R13: 00007f6012cd6ef0 R14: 00007f6012cd6eb0 R15: 00007f6008c00000 The buggy address belongs to the virtual mapping at [ffffc9000bfe8000, ffffc9000bff1000) created by: copy_process+0x5d1/0x3d50 kernel/fork.c:2224 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x7e pfn:0x335bc flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 000000000000007e 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 10425, tgid 10425 (syz.1.2160), ts 657538684780, free_ts 657509536894 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2269 vm_area_alloc_pages mm/vmalloc.c:3591 [inline] __vmalloc_area_node mm/vmalloc.c:3669 [inline] __vmalloc_node_range_noprof+0x9c9/0x1380 mm/vmalloc.c:3846 alloc_thread_stack_node kernel/fork.c:314 [inline] dup_task_struct+0x444/0x8c0 kernel/fork.c:1116 copy_process+0x5d1/0x3d50 kernel/fork.c:2224 kernel_clone+0x226/0x8e0 kernel/fork.c:2806 __do_sys_clone3 kernel/fork.c:3110 [inline] __se_sys_clone3+0x2d8/0x360 kernel/fork.c:3089 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 7906 tgid 7906 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe39/0x18b0 mm/page_alloc.c:2706 folios_put_refs+0x76c/0x860 mm/swap.c:962 folio_batch_release include/linux/pagevec.h:101 [inline] truncate_inode_pages_range+0x460/0x10e0 mm/truncate.c:330 kill_bdev block/bdev.c:91 [inline] blkdev_flush_mapping+0x108/0x270 block/bdev.c:670 blkdev_put_whole block/bdev.c:677 [inline] bdev_release+0x460/0x700 block/bdev.c:1102 blkdev_release+0x15/0x20 block/fops.c:635 __fput+0x23e/0xa50 fs/file_table.c:450 __do_sys_close fs/open.c:1554 [inline] __se_sys_close fs/open.c:1539 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1539 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc9000bfef500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000bfef580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9000bfef600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffffc9000bfef680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000bfef700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 0f 8c 73 ff ff ff jl 0xffffff79 6: 48 c7 c7 00 4e 2e 96 mov $0xffffffff962e4e00,%rdi d: e8 a7 d8 89 00 call 0x89d8b9 12: e9 62 ff ff ff jmp 0xffffff79 17: 66 90 xchg %ax,%ax 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 90 nop 1f: 90 nop 20: 90 nop 21: 90 nop 22: 90 nop 23: 90 nop 24: 90 nop 25: 90 nop 26: 90 nop 27: 90 nop 28: 90 nop * 29: f3 0f 1e fa endbr64 <-- trapping instruction 2d: 48 c7 c0 20 66 cb 8b mov $0xffffffff8bcb6620,%rax 34: 48 39 c7 cmp %rax,%rdi 37: 0f 93 c0 setae %al 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: c1 0a a0 rorl $0xa0,(%rdx)