syzbot


KASAN: null-ptr-deref Write in xfs_filestream_select_ag (2)

Status: moderation: reported on 2024/10/05 08:29
Subsystems: xfs
[Documentation on labels]
Reported-by: syzbot+3fa6d3d1b4ccdf11034d@syzkaller.appspotmail.com
First crash: 4d09h, last: 4d09h
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: null-ptr-deref Write in xfs_filestream_select_ag xfs C done done 18 285d 563d 0/28 auto-obsoleted due to no activity on 2024/04/02 22:17

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
BUG: KASAN: null-ptr-deref in atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline]
BUG: KASAN: null-ptr-deref in xfs_filestream_create_association fs/xfs/xfs_filestream.c:320 [inline]
BUG: KASAN: null-ptr-deref in xfs_filestream_select_ag+0x13ed/0x1d80 fs/xfs/xfs_filestream.c:371
Write of size 4 at addr 0000000000000010 by task syz.0.0/5120

CPU: 0 UID: 0 PID: 5120 Comm: syz.0.0 Not tainted 6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7 #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:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_report+0xe8/0x550 mm/kasan/report.c:491
 kasan_report+0x143/0x180 mm/kasan/report.c:601
 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189
 instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
 atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline]
 xfs_filestream_create_association fs/xfs/xfs_filestream.c:320 [inline]
 xfs_filestream_select_ag+0x13ed/0x1d80 fs/xfs/xfs_filestream.c:371
 xfs_bmap_btalloc_filestreams fs/xfs/libxfs/xfs_bmap.c:3692 [inline]
 xfs_bmap_btalloc+0x12c8/0x2820 fs/xfs/libxfs/xfs_bmap.c:3806
 xfs_bmap_alloc_userdata fs/xfs/libxfs/xfs_bmap.c:4213 [inline]
 xfs_bmapi_allocate+0x451/0xc70 fs/xfs/libxfs/xfs_bmap.c:4240
 xfs_bmapi_convert_one_delalloc fs/xfs/libxfs/xfs_bmap.c:4749 [inline]
 xfs_bmapi_convert_delalloc+0x9a0/0x1970 fs/xfs/libxfs/xfs_bmap.c:4804
 xfs_map_blocks+0x7b7/0x1050 fs/xfs/xfs_aops.c:363
 iomap_writepage_map_blocks fs/iomap/buffered-io.c:1850 [inline]
 iomap_writepage_map fs/iomap/buffered-io.c:1998 [inline]
 iomap_writepages+0xd49/0x2ac0 fs/iomap/buffered-io.c:2052
 xfs_vm_writepages+0xfc/0x150 fs/xfs/xfs_aops.c:477
 do_writepages+0x35d/0x870 mm/page-writeback.c:2683
 filemap_fdatawrite_wbc+0x125/0x180 mm/filemap.c:398
 __filemap_fdatawrite_range mm/filemap.c:431 [inline]
 file_write_and_wait_range+0x195/0x280 mm/filemap.c:788
 xfs_file_fsync+0x1d3/0xa80 fs/xfs/xfs_file.c:138
 generic_write_sync include/linux/fs.h:2871 [inline]
 xfs_file_buffered_write+0x9a8/0xac0 fs/xfs/xfs_file.c:799
 new_sync_write fs/read_write.c:590 [inline]
 vfs_write+0xa6d/0xc90 fs/read_write.c:683
 ksys_write+0x183/0x2b0 fs/read_write.c:736
 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:0x7fd07cd7dff9
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:00007fd07daff038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fd07cf36130 RCX: 00007fd07cd7dff9
RDX: 0000000000000473 RSI: 0000000020004200 RDI: 0000000000000007
RBP: 00007fd07cdf0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fd07cf36130 R15: 00007ffe0489d6d8
 </TASK>
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/01 08:27 upstream e32cde8d2bd7 bbd4e0a4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: null-ptr-deref Write in xfs_filestream_select_ag
* Struck through repros no longer work on HEAD.