bcachefs (loop0): reading quotas
bcachefs (loop0): quotas 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: 5334 Comm: syz.0.0 Not tainted 6.12.0-syzkaller-09073-g9f16d5e6f220 #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:53 [inline]
should_fail_ex+0x3b0/0x4e0 lib/fault-inject.c:154
should_failslab+0xac/0x100 mm/failslab.c:46
slab_pre_alloc_hook mm/slub.c:4038 [inline]
slab_alloc_node mm/slub.c:4114 [inline]
__do_kmalloc_node mm/slub.c:4263 [inline]
__kmalloc_node_track_caller_noprof+0xda/0x440 mm/slub.c:4283
__do_krealloc mm/slab_common.c:1229 [inline]
krealloc_noprof+0x88/0x120 mm/slab_common.c:1278
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+0x4c1/0x9d0 fs/bcachefs/printbuf.c:155
bch2_prt_printf+0x559/0x6d0 fs/bcachefs/printbuf.c:190
trace_bucket_alloc2+0x119/0xba0 fs/bcachefs/alloc_foreground.c:564
bch2_bucket_alloc_trans+0x3a43/0x3a50 fs/bcachefs/alloc_foreground.c:678
bch2_bucket_alloc_set_trans+0x517/0xd30 fs/bcachefs/alloc_foreground.c:808
__open_bucket_add_buckets+0x13d0/0x1ec0 fs/bcachefs/alloc_foreground.c:1057
open_bucket_add_buckets+0x33a/0x410 fs/bcachefs/alloc_foreground.c:1101
bch2_alloc_sectors_start_trans+0xce9/0x2030
__bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:339 [inline]
bch2_btree_reserve_get+0x612/0x1890 fs/bcachefs/btree_update_interior.c:549
bch2_btree_update_start+0xe56/0x14e0 fs/bcachefs/btree_update_interior.c:1247
bch2_btree_split_leaf+0x123/0x840 fs/bcachefs/btree_update_interior.c:1856
bch2_trans_commit_error+0x212/0x1390 fs/bcachefs/btree_trans_commit.c:942
__bch2_trans_commit+0x7ead/0x93c0 fs/bcachefs/btree_trans_commit.c:1140
bch2_trans_commit fs/bcachefs/btree_update.h:184 [inline]
bch2_logged_op_start+0x1c8/0x310 fs/bcachefs/logged_ops.c:92
bch2_truncate+0x19e/0x2d0 fs/bcachefs/io_misc.c:294
bchfs_truncate+0x85f/0xc90 fs/bcachefs/fs-io.c:464
notify_change+0xbca/0xe90 fs/attr.c:552
do_truncate+0x220/0x310 fs/open.c:65
handle_truncate fs/namei.c:3449 [inline]
do_open fs/namei.c:3832 [inline]
path_openat+0x2e1e/0x3590 fs/namei.c:3987
do_filp_open+0x27f/0x4e0 fs/namei.c:4014
do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
do_sys_open fs/open.c:1417 [inline]
__do_sys_openat fs/open.c:1433 [inline]
__se_sys_openat fs/open.c:1428 [inline]
__x64_sys_openat+0x247/0x2a0 fs/open.c:1428
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:0x7f15df77e819
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:00007f15e0550038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f15df935fa0 RCX: 00007f15df77e819
RDX: 000000000000275a RSI: 0000000020000280 RDI: ffffffffffffff9c
RBP: 00007f15e0550090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007f15df935fa0 R15: 00007ffc0b502bd8
==================================================================
BUG: KASAN: slab-out-of-bounds in memscan+0x62/0x80 lib/string.c:717
Read of size 1 at addr ffff888011cbd177 by task syz.0.0/5334
CPU: 0 UID: 0 PID: 5334 Comm: syz.0.0 Not tainted 6.12.0-syzkaller-09073-g9f16d5e6f220 #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:378 [inline]
print_report+0x169/0x550 mm/kasan/report.c:489
kasan_report+0x143/0x180 mm/kasan/report.c:602
memscan+0x62/0x80 lib/string.c:717
__printbuf_do_indent fs/bcachefs/printbuf.c:101 [inline]
printbuf_do_indent+0x10d/0x9d0 fs/bcachefs/printbuf.c:155
bch2_prt_printf+0x559/0x6d0 fs/bcachefs/printbuf.c:190
trace_bucket_alloc2+0x119/0xba0 fs/bcachefs/alloc_foreground.c:564
bch2_bucket_alloc_trans+0x3a43/0x3a50 fs/bcachefs/alloc_foreground.c:678
bch2_bucket_alloc_set_trans+0x517/0xd30 fs/bcachefs/alloc_foreground.c:808
__open_bucket_add_buckets+0x13d0/0x1ec0 fs/bcachefs/alloc_foreground.c:1057
open_bucket_add_buckets+0x33a/0x410 fs/bcachefs/alloc_foreground.c:1101
bch2_alloc_sectors_start_trans+0xce9/0x2030
__bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:339 [inline]
bch2_btree_reserve_get+0x612/0x1890 fs/bcachefs/btree_update_interior.c:549
bch2_btree_update_start+0xe56/0x14e0 fs/bcachefs/btree_update_interior.c:1247
bch2_btree_split_leaf+0x123/0x840 fs/bcachefs/btree_update_interior.c:1856
bch2_trans_commit_error+0x212/0x1390 fs/bcachefs/btree_trans_commit.c:942
__bch2_trans_commit+0x7ead/0x93c0 fs/bcachefs/btree_trans_commit.c:1140
bch2_trans_commit fs/bcachefs/btree_update.h:184 [inline]
bch2_logged_op_start+0x1c8/0x310 fs/bcachefs/logged_ops.c:92
bch2_truncate+0x19e/0x2d0 fs/bcachefs/io_misc.c:294
bchfs_truncate+0x85f/0xc90 fs/bcachefs/fs-io.c:464
notify_change+0xbca/0xe90 fs/attr.c:552
do_truncate+0x220/0x310 fs/open.c:65
handle_truncate fs/namei.c:3449 [inline]
do_open fs/namei.c:3832 [inline]
path_openat+0x2e1e/0x3590 fs/namei.c:3987
do_filp_open+0x27f/0x4e0 fs/namei.c:4014
do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
do_sys_open fs/open.c:1417 [inline]
__do_sys_openat fs/open.c:1433 [inline]
__se_sys_openat fs/open.c:1428 [inline]
__x64_sys_openat+0x247/0x2a0 fs/open.c:1428
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:0x7f15df77e819
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:00007f15e0550038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f15df935fa0 RCX: 00007f15df77e819
RDX: 000000000000275a RSI: 0000000020000280 RDI: ffffffffffffff9c
RBP: 00007f15e0550090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007f15df935fa0 R15: 00007ffc0b502bd8
Allocated by task 5334:
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:4264 [inline]
__kmalloc_node_track_caller_noprof+0x225/0x440 mm/slub.c:4283
__do_krealloc mm/slab_common.c:1229 [inline]
krealloc_noprof+0x88/0x120 mm/slab_common.c:1278
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/0xba0 fs/bcachefs/alloc_foreground.c:564
bch2_bucket_alloc_trans+0x3a43/0x3a50 fs/bcachefs/alloc_foreground.c:678
bch2_bucket_alloc_set_trans+0x517/0xd30 fs/bcachefs/alloc_foreground.c:808
__open_bucket_add_buckets+0x13d0/0x1ec0 fs/bcachefs/alloc_foreground.c:1057
open_bucket_add_buckets+0x33a/0x410 fs/bcachefs/alloc_foreground.c:1101
bch2_alloc_sectors_start_trans+0xce9/0x2030
__bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:339 [inline]
bch2_btree_reserve_get+0x612/0x1890 fs/bcachefs/btree_update_interior.c:549
bch2_btree_update_start+0xe56/0x14e0 fs/bcachefs/btree_update_interior.c:1247
bch2_btree_split_leaf+0x123/0x840 fs/bcachefs/btree_update_interior.c:1856
bch2_trans_commit_error+0x212/0x1390 fs/bcachefs/btree_trans_commit.c:942
__bch2_trans_commit+0x7ead/0x93c0 fs/bcachefs/btree_trans_commit.c:1140
bch2_trans_commit fs/bcachefs/btree_update.h:184 [inline]
bch2_logged_op_start+0x1c8/0x310 fs/bcachefs/logged_ops.c:92
bch2_truncate+0x19e/0x2d0 fs/bcachefs/io_misc.c:294
bchfs_truncate+0x85f/0xc90 fs/bcachefs/fs-io.c:464
notify_change+0xbca/0xe90 fs/attr.c:552
do_truncate+0x220/0x310 fs/open.c:65
handle_truncate fs/namei.c:3449 [inline]
do_open fs/namei.c:3832 [inline]
path_openat+0x2e1e/0x3590 fs/namei.c:3987
do_filp_open+0x27f/0x4e0 fs/namei.c:4014
do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
do_sys_open fs/open.c:1417 [inline]
__do_sys_openat fs/open.c:1433 [inline]
__se_sys_openat fs/open.c:1428 [inline]
__x64_sys_openat+0x247/0x2a0 fs/open.c:1428
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 ffff888011cbd160
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 [ffff888011cbd160, ffff888011cbd170)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11cbd
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88801ac41640 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080800080 00000001f5000000 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 5334, tgid 5333 (syz.0.0), ts 69628636958, free_ts 68454680953
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1556
prep_new_page mm/page_alloc.c:1564 [inline]
get_page_from_freelist+0x3649/0x3790 mm/page_alloc.c:3474
__alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4751
alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
alloc_slab_page+0x6a/0x140 mm/slub.c:2412
allocate_slab+0x5a/0x2f0 mm/slub.c:2578
new_slab mm/slub.c:2631 [inline]
___slab_alloc+0xcd1/0x14b0 mm/slub.c:3818
__slab_alloc+0x58/0xa0 mm/slub.c:3908
__slab_alloc_node mm/slub.c:3961 [inline]
slab_alloc_node mm/slub.c:4122 [inline]
__do_kmalloc_node mm/slub.c:4263 [inline]
__kmalloc_node_track_caller_noprof+0x281/0x440 mm/slub.c:4283
__do_krealloc mm/slab_common.c:1229 [inline]
krealloc_noprof+0x88/0x120 mm/slab_common.c:1278
bch2_printbuf_make_room+0x1f1/0x350 fs/bcachefs/printbuf.c:59
bch2_prt_printf+0x267/0x6d0 fs/bcachefs/printbuf.c:186
bch2_sb_validate+0x739/0xf70 fs/bcachefs/super-io.c:437
bch2_write_super+0x1149/0x3c50 fs/bcachefs/super-io.c:993
bch2_fs_recovery+0x3339/0x39d0 fs/bcachefs/recovery.c:959
bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1037
page last free pid 5334 tgid 5333 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1127 [inline]
free_unref_folios+0xf37/0x1a20 mm/page_alloc.c:2704
folios_put_refs+0x76c/0x860 mm/swap.c:962
free_pages_and_swap_cache+0x5c8/0x690 mm/swap_state.c:335
__tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline]
tlb_batch_pages_flush mm/mmu_gather.c:149 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:366 [inline]
tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:373
tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:465
vms_clear_ptes+0x437/0x530 mm/vma.c:1143
vms_complete_munmap_vmas+0x210/0x8f0 mm/vma.c:1185
do_vmi_align_munmap+0x5ef/0x6f0 mm/vma.c:1444
do_vmi_munmap+0x24e/0x2d0 mm/vma.c:1492
__vm_munmap+0x24c/0x480 mm/mmap.c:1367
__do_sys_munmap mm/mmap.c:1384 [inline]
__se_sys_munmap mm/mmap.c:1381 [inline]
__x64_sys_munmap+0x60/0x70 mm/mmap.c:1381
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:
ffff888011cbd000: fa fb fc fc fa fb fc fc 00 00 fc fc 00 03 fc fc
ffff888011cbd080: 00 03 fc fc 00 03 fc fc 00 00 fc fc 00 00 fc fc
>ffff888011cbd100: 00 00 fc fc 00 00 fc fc fa fb fc fc 00 00 fc fc
^
ffff888011cbd180: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888011cbd200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================