syzbot


KCSAN: data-race in fat16_ent_get / fat16_ent_put (2)

Status: moderation: reported on 2024/12/06 15:11
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+ecf5a95b754e6caaf8d6@syzkaller.appspotmail.com
First crash: 14d, last: 14d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in fat16_ent_get / fat16_ent_put exfat 1 80d 80d 0/28 auto-obsoleted due to no activity on 2024/11/19 02:40

Sample crash report:
RBP: 0000000020000180 R08: 00007f66e0de4f10 R09: 0000000001a4243c
R10: 0000000001a4243c R11: 0000000000000246 R12: 0000000020000100
R13: 00007f66e0de4ed0 R14: 0000000000000000 R15: 0000000020000200
 </TASK>
==================================================================
BUG: KCSAN: data-race in fat16_ent_get / fat16_ent_put

read to 0xffff88811b53a6d8 of 2 bytes by task 7893 on cpu 0:
 fat16_ent_get+0x23/0x70 fs/fat/fatent.c:140
 fat_ent_read+0x3e0/0x5a0 fs/fat/fatent.c:372
 fat_chain_add+0x12d/0x400 fs/fat/misc.c:133
 fat_add_cluster fs/fat/inode.c:112 [inline]
 __fat_get_block fs/fat/inode.c:154 [inline]
 fat_get_block+0x46b/0x5e0 fs/fat/inode.c:189
 __block_write_begin_int+0x417/0xfa0 fs/buffer.c:2116
 block_write_begin fs/buffer.c:2226 [inline]
 cont_write_begin+0x546/0x860 fs/buffer.c:2577
 fat_write_begin+0x51/0xe0 fs/fat/inode.c:228
 cont_expand_zero fs/buffer.c:2504 [inline]
 cont_write_begin+0x18b/0x860 fs/buffer.c:2567
 fat_write_begin+0x51/0xe0 fs/fat/inode.c:228
 generic_cont_expand_simple+0xaa/0x150 fs/buffer.c:2468
 fat_cont_expand+0x3a/0x160 fs/fat/file.c:223
 fat_setattr+0x2aa/0x840 fs/fat/file.c:513
 notify_change+0x85c/0x8e0 fs/attr.c:552
 do_truncate fs/open.c:65 [inline]
 do_ftruncate+0x3cf/0x460 fs/open.c:181
 do_sys_ftruncate fs/open.c:196 [inline]
 __do_sys_ftruncate fs/open.c:201 [inline]
 __se_sys_ftruncate fs/open.c:199 [inline]
 __x64_sys_ftruncate+0x67/0xc0 fs/open.c:199
 x64_sys_call+0x9d9/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:78
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

write to 0xffff88811b53a6d8 of 2 bytes by task 7897 on cpu 1:
 fat16_ent_put+0x28/0x60 fs/fat/fatent.c:183
 fat_ent_write+0x66/0xe0 fs/fat/fatent.c:417
 fat_chain_add+0x15f/0x400 fs/fat/misc.c:136
 fat_add_cluster fs/fat/inode.c:112 [inline]
 __fat_get_block fs/fat/inode.c:154 [inline]
 fat_get_block+0x46b/0x5e0 fs/fat/inode.c:189
 __block_write_begin_int+0x417/0xfa0 fs/buffer.c:2116
 block_write_begin fs/buffer.c:2226 [inline]
 cont_write_begin+0x546/0x860 fs/buffer.c:2577
 fat_write_begin+0x51/0xe0 fs/fat/inode.c:228
 cont_expand_zero fs/buffer.c:2504 [inline]
 cont_write_begin+0x18b/0x860 fs/buffer.c:2567
 fat_write_begin+0x51/0xe0 fs/fat/inode.c:228
 generic_cont_expand_simple+0xaa/0x150 fs/buffer.c:2468
 fat_cont_expand+0x3a/0x160 fs/fat/file.c:223
 fat_setattr+0x2aa/0x840 fs/fat/file.c:513
 notify_change+0x85c/0x8e0 fs/attr.c:552
 do_truncate+0x116/0x160 fs/open.c:65
 vfs_truncate+0x1e9/0x240 fs/open.c:111
 do_sys_truncate+0x95/0x130 fs/open.c:134
 __do_sys_truncate fs/open.c:146 [inline]
 __se_sys_truncate fs/open.c:144 [inline]
 __x64_sys_truncate+0x31/0x40 fs/open.c:144
 x64_sys_call+0x26d0/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:77
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0xffff -> 0x126d

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 7897 Comm: syz.2.1286 Not tainted 6.13.0-rc1-syzkaller-00182-gb8f52214c61a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================
FAT-fs (loop2): error, clusters badly computed (4595 != 18)
FAT-fs (loop2): Filesystem has been set read-only
FAT-fs (loop2): error, clusters badly computed (4596 != 19)
FAT-fs (loop2): error, clusters badly computed (4597 != 20)
FAT-fs (loop2): error, clusters badly computed (4598 != 21)
FAT-fs (loop2): error, clusters badly computed (4599 != 22)
FAT-fs (loop2): error, clusters badly computed (4600 != 23)

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/06 15:10 upstream b8f52214c61a 946d28f0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in fat16_ent_get / fat16_ent_put
* Struck through repros no longer work on HEAD.