syzbot


KCSAN: data-race in fat16_ent_get / fat16_ent_put

Status: auto-obsoleted due to no activity on 2024/11/19 02:40
Subsystems: exfat
[Documentation on labels]
Reported-by: syzbot+3999cae1c2d59c2cc8b9@syzkaller.appspotmail.com
First crash: 89d, last: 89d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] Fix BUG: KCSAN: data-race in fat16_ent_get / fat16_ent_put 3 (3) 2024/11/05 02:39
[syzbot] [exfat?] KCSAN: data-race in fat16_ent_get / fat16_ent_put 0 (1) 2024/10/02 10:25
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 (2) exfat 1 23d 23d 0/28 moderation: reported on 2024/12/06 15:11

Sample crash report:
==================================================================
BUG: KCSAN: data-race in fat16_ent_get / fat16_ent_put

write to 0xffff888104b849d2 of 2 bytes by task 13613 on cpu 0:
 fat16_ent_put+0x28/0x60 fs/fat/fatent.c:183
 fat_free_clusters+0x2a6/0x7a0 fs/fat/fatent.c:597
 fat_free fs/fat/file.c:376 [inline]
 fat_truncate_blocks+0x4a8/0x530 fs/fat/file.c:394
 fat_evict_inode+0x102/0x160 fs/fat/inode.c:656
 evict+0x2f0/0x580 fs/inode.c:723
 iput_final fs/inode.c:1875 [inline]
 iput+0x42a/0x5b0 fs/inode.c:1901
 do_unlinkat+0x282/0x4c0 fs/namei.c:4540
 __do_sys_unlink fs/namei.c:4581 [inline]
 __se_sys_unlink fs/namei.c:4579 [inline]
 __x64_sys_unlink+0x2e/0x40 fs/namei.c:4579
 x64_sys_call+0x280f/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:88
 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

read to 0xffff888104b849d2 of 2 bytes by task 14376 on cpu 1:
 fat16_ent_get+0x23/0x70 fs/fat/fatent.c:140
 fat_ent_read+0x3e0/0x5a0 fs/fat/fatent.c:372
 fat_get_cluster+0x4b9/0x830 fs/fat/cache.c:266
 fat_free fs/fat/file.c:346 [inline]
 fat_truncate_blocks+0x271/0x530 fs/fat/file.c:394
 fat_write_failed fs/fat/inode.c:218 [inline]
 fat_write_begin+0xc0/0xe0 fs/fat/inode.c:232
 generic_perform_write+0x1a8/0x4a0 mm/filemap.c:4054
 __generic_file_write_iter+0xa1/0x120 mm/filemap.c:4155
 generic_file_write_iter+0x77/0x1c0 mm/filemap.c:4181
 __kernel_write_iter+0x24b/0x4e0 fs/read_write.c:616
 dump_emit_page fs/coredump.c:884 [inline]
 dump_user_range+0x3a7/0x550 fs/coredump.c:945
 elf_core_dump+0x1b66/0x1c60 fs/binfmt_elf.c:2121
 do_coredump+0x1736/0x1ce0 fs/coredump.c:758
 get_signal+0xdc0/0x1070 kernel/signal.c:2902
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 irqentry_exit_to_user_mode+0x9a/0x130 kernel/entry/common.c:231
 irqentry_exit+0x12/0x50 kernel/entry/common.c:334
 exc_general_protection+0x33d/0x4d0 arch/x86/kernel/traps.c:693
 asm_exc_general_protection+0x26/0x30 arch/x86/include/asm/idtentry.h:617

value changed: 0x03ea -> 0x0000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 14376 Comm: syz.3.1622 Not tainted 6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================
FAT-fs (loop3): error, fat_get_cluster: invalid cluster chain (i_pos 1050)
FAT-fs (loop3): Filesystem has been set read-only
FAT-fs (loop3): error, fat_free_clusters: deleting FAT entry beyond EOF

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/02 10:06 upstream e32cde8d2bd7 ea2b66a6 .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.