bcachefs (loop0): check_unreachable_inodes... done bcachefs (loop0): check_subvolume_structure... done bcachefs (loop0): check_directory_structure... done bcachefs (loop0): check_nlinks... done bcachefs (loop0): resume_logged_ops... done bcachefs (loop0): delete_dead_inodes... done bcachefs (loop0): set_fs_needs_rebalance... done bcachefs (loop0): done starting filesystem FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 0 UID: 0 PID: 5322 Comm: syz.0.0 Not tainted 6.14.0-rc7-syzkaller-00137-g5fc319360819 #0 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+0x241/0x360 lib/dump_stack.c:120 fail_dump lib/fault-inject.c:73 [inline] should_fail_ex+0x40a/0x550 lib/fault-inject.c:174 should_failslab+0xac/0x100 mm/failslab.c:46 slab_pre_alloc_hook mm/slub.c:4068 [inline] slab_alloc_node mm/slub.c:4144 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_node_track_caller_noprof+0xdc/0x4c0 mm/slub.c:4313 __do_krealloc mm/slub.c:4820 [inline] krealloc_noprof+0x10f/0x300 mm/slub.c:4873 bch2_printbuf_make_room+0x1f1/0x350 fs/bcachefs/printbuf.c:59 printbuf_insert_spaces+0x56/0x530 fs/bcachefs/printbuf.c:81 __printbuf_do_indent fs/bcachefs/printbuf.c:138 [inline] printbuf_do_indent+0x4c4/0xa00 fs/bcachefs/printbuf.c:155 bch2_prt_printf+0x559/0x6d0 fs/bcachefs/printbuf.c:190 trace_bucket_alloc2+0x119/0xb90 fs/bcachefs/alloc_foreground.c:485 bch2_bucket_alloc_trans+0x2e89/0x2ea0 fs/bcachefs/alloc_foreground.c:604 bch2_bucket_alloc_set_trans+0x57c/0xd60 fs/bcachefs/alloc_foreground.c:730 __open_bucket_add_buckets+0x13e1/0x1e50 fs/bcachefs/alloc_foreground.c:973 open_bucket_add_buckets+0x33a/0x410 fs/bcachefs/alloc_foreground.c:1017 bch2_alloc_sectors_start_trans+0xce9/0x2030 __bch2_write+0x769/0x5a80 fs/bcachefs/io_write.c:1466 bch2_write+0x865/0x1660 fs/bcachefs/io_write.c:1659 closure_queue include/linux/closure.h:270 [inline] closure_call include/linux/closure.h:432 [inline] bch2_writepage_do_io fs/bcachefs/fs-io-buffered.c:469 [inline] bch2_writepages+0x284/0x390 fs/bcachefs/fs-io-buffered.c:652 do_writepages+0x35f/0x880 mm/page-writeback.c:2687 filemap_fdatawrite_wbc mm/filemap.c:388 [inline] __filemap_fdatawrite_range mm/filemap.c:421 [inline] file_write_and_wait_range+0x2a3/0x3c0 mm/filemap.c:796 bch2_fsync+0x13a/0x350 fs/bcachefs/fs-io.c:228 generic_write_sync include/linux/fs.h:2970 [inline] bch2_write_iter+0x298a/0x2cd0 fs/bcachefs/fs-io-buffered.c:1072 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xacf/0xd10 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:0x7fdb6c58d169 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdb6d427038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fdb6c7a5fa0 RCX: 00007fdb6c58d169 RDX: 0000000000001001 RSI: 0000200000000600 RDI: 0000000000000006 RBP: 00007fdb6d427090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 00007fdb6c7a5fa0 R15: 00007ffd2e301cc8 ================================================================== BUG: KASAN: slab-out-of-bounds in memscan+0x62/0x80 lib/string.c:728 Read of size 1 at addr ffff8880417e6a57 by task syz.0.0/5322 CPU: 0 UID: 0 PID: 5322 Comm: syz.0.0 Not tainted 6.14.0-rc7-syzkaller-00137-g5fc319360819 #0 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+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 memscan+0x62/0x80 lib/string.c:728 _Z7memscanPvU25pass_dynamic_object_size0im include/linux/fortify-string.h:708 [inline] __printbuf_do_indent fs/bcachefs/printbuf.c:101 [inline] printbuf_do_indent+0x110/0xa00 fs/bcachefs/printbuf.c:155 bch2_prt_printf+0x559/0x6d0 fs/bcachefs/printbuf.c:190 trace_bucket_alloc2+0x119/0xb90 fs/bcachefs/alloc_foreground.c:485 bch2_bucket_alloc_trans+0x2e89/0x2ea0 fs/bcachefs/alloc_foreground.c:604 bch2_bucket_alloc_set_trans+0x57c/0xd60 fs/bcachefs/alloc_foreground.c:730 __open_bucket_add_buckets+0x13e1/0x1e50 fs/bcachefs/alloc_foreground.c:973 open_bucket_add_buckets+0x33a/0x410 fs/bcachefs/alloc_foreground.c:1017 bch2_alloc_sectors_start_trans+0xce9/0x2030 __bch2_write+0x769/0x5a80 fs/bcachefs/io_write.c:1466 bch2_write+0x865/0x1660 fs/bcachefs/io_write.c:1659 closure_queue include/linux/closure.h:270 [inline] closure_call include/linux/closure.h:432 [inline] bch2_writepage_do_io fs/bcachefs/fs-io-buffered.c:469 [inline] bch2_writepages+0x284/0x390 fs/bcachefs/fs-io-buffered.c:652 do_writepages+0x35f/0x880 mm/page-writeback.c:2687 filemap_fdatawrite_wbc mm/filemap.c:388 [inline] __filemap_fdatawrite_range mm/filemap.c:421 [inline] file_write_and_wait_range+0x2a3/0x3c0 mm/filemap.c:796 bch2_fsync+0x13a/0x350 fs/bcachefs/fs-io.c:228 generic_write_sync include/linux/fs.h:2970 [inline] bch2_write_iter+0x298a/0x2cd0 fs/bcachefs/fs-io-buffered.c:1072 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xacf/0xd10 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:0x7fdb6c58d169 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdb6d427038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fdb6c7a5fa0 RCX: 00007fdb6c58d169 RDX: 0000000000001001 RSI: 0000200000000600 RDI: 0000000000000006 RBP: 00007fdb6d427090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 00007fdb6c7a5fa0 R15: 00007ffd2e301cc8 Allocated by task 5322: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4294 [inline] __kmalloc_node_track_caller_noprof+0x28b/0x4c0 mm/slub.c:4313 __do_krealloc mm/slub.c:4820 [inline] krealloc_noprof+0x10f/0x300 mm/slub.c:4873 bch2_printbuf_make_room+0x1f1/0x350 fs/bcachefs/printbuf.c:59 bch2_prt_printf+0x267/0x6d0 fs/bcachefs/printbuf.c:186 trace_bucket_alloc2+0x119/0xb90 fs/bcachefs/alloc_foreground.c:485 bch2_bucket_alloc_trans+0x2e89/0x2ea0 fs/bcachefs/alloc_foreground.c:604 bch2_bucket_alloc_set_trans+0x57c/0xd60 fs/bcachefs/alloc_foreground.c:730 __open_bucket_add_buckets+0x13e1/0x1e50 fs/bcachefs/alloc_foreground.c:973 open_bucket_add_buckets+0x33a/0x410 fs/bcachefs/alloc_foreground.c:1017 bch2_alloc_sectors_start_trans+0xce9/0x2030 __bch2_write+0x769/0x5a80 fs/bcachefs/io_write.c:1466 bch2_write+0x865/0x1660 fs/bcachefs/io_write.c:1659 closure_queue include/linux/closure.h:270 [inline] closure_call include/linux/closure.h:432 [inline] bch2_writepage_do_io fs/bcachefs/fs-io-buffered.c:469 [inline] bch2_writepages+0x284/0x390 fs/bcachefs/fs-io-buffered.c:652 do_writepages+0x35f/0x880 mm/page-writeback.c:2687 filemap_fdatawrite_wbc mm/filemap.c:388 [inline] __filemap_fdatawrite_range mm/filemap.c:421 [inline] file_write_and_wait_range+0x2a3/0x3c0 mm/filemap.c:796 bch2_fsync+0x13a/0x350 fs/bcachefs/fs-io.c:228 generic_write_sync include/linux/fs.h:2970 [inline] bch2_write_iter+0x298a/0x2cd0 fs/bcachefs/fs-io-buffered.c:1072 new_sync_write fs/read_write.c:586 [inline] vfs_write+0xacf/0xd10 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 The buggy address belongs to the object at ffff8880417e6a40 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 7 bytes to the right of allocated 16-byte region [ffff8880417e6a40, ffff8880417e6a50) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x417e6 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801b041640 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080800080 00000000f5000000 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 791, tgid 791 (kworker/0:2), ts 37997479583, free_ts 37785983190 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4740 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_noprof+0x2e6/0x4c0 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] kmalloc_array_noprof include/linux/slab.h:946 [inline] drm_atomic_helper_dirtyfb+0x171/0xe60 drivers/gpu/drm/drm_damage_helper.c:141 drm_fbdev_shmem_helper_fb_dirty+0x151/0x2c0 drivers/gpu/drm/drm_fbdev_shmem.c:117 drm_fb_helper_fb_dirty drivers/gpu/drm/drm_fb_helper.c:376 [inline] drm_fb_helper_damage_work+0x275/0x880 drivers/gpu/drm/drm_fb_helper.c:399 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page last free pid 4730 tgid 4730 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe0d/0x10e0 mm/page_alloc.c:2660 discard_slab mm/slub.c:2684 [inline] __put_partials+0x160/0x1c0 mm/slub.c:3153 put_cpu_partial+0x17c/0x250 mm/slub.c:3228 __slab_free+0x290/0x380 mm/slub.c:4479 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4115 [inline] slab_alloc_node mm/slub.c:4164 [inline] kmem_cache_alloc_noprof+0x1d9/0x380 mm/slub.c:4171 getname_flags+0xb7/0x540 fs/namei.c:139 getname fs/namei.c:223 [inline] __do_sys_symlink fs/namei.c:4718 [inline] __se_sys_symlink fs/namei.c:4716 [inline] __x64_sys_symlink+0x5d/0x90 fs/namei.c:4716 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: ffff8880417e6900: 00 00 fc fc 00 00 fc fc 00 00 fc fc 00 00 fc fc ffff8880417e6980: 00 00 fc fc 00 00 fc fc 00 00 fc fc fa fb fc fc >ffff8880417e6a00: 00 00 fc fc 00 00 fc fc 00 00 fc fc 00 00 fc fc ^ ffff8880417e6a80: 00 03 fc fc 00 07 fc fc 00 00 fc fc 00 00 fc fc ffff8880417e6b00: 00 01 fc fc 00 00 fc fc 00 00 fc fc 00 00 fc fc ==================================================================