On Mon, Dec 30, 2024 at 11:53 AM Gao Xiang <xi...@kernel.org> wrote: > > Hi exfat maintainers, Hi Gao,
We have a patch for this and will send a PR to Linus soon. Thanks! > > On Sat, Dec 28, 2024 at 11:45:22PM -0800, syzbot wrote: > > Hello, > > > > syzbot found the following issue on: > > > > HEAD commit: 9b2ffa6148b1 Merge tag 'mtd/fixes-for-6.13-rc5' of git://g.. > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=112374c4580000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=f9048090d7bb0d06 > > dashboard link: https://syzkaller.appspot.com/bug?extid=1379ee6b9a14d5dacaf2 > > compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for > > Debian) 2.40 > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > Downloadable assets: > > disk image: > > https://storage.googleapis.com/syzbot-assets/244f25c1a275/disk-9b2ffa61.raw.xz > > vmlinux: > > https://storage.googleapis.com/syzbot-assets/0d14fc6634fd/vmlinux-9b2ffa61.xz > > kernel image: > > https://storage.googleapis.com/syzbot-assets/cb152a4c0fd2/bzImage-9b2ffa61.xz > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: syzbot+1379ee6b9a14d5dac...@syzkaller.appspotmail.com > > > > exFAT-fs (loop7): failed to load upcase table (idx : 0x00010000, chksum : > > 0x1a9973fb, utbl_chksum : 0xe619d30d) > > ===================================================== > > BUG: KMSAN: uninit-value in erofs_read_superblock fs/erofs/super.c:274 > > [inline] > > BUG: KMSAN: uninit-value in erofs_fc_fill_super+0x66a/0x2520 > > fs/erofs/super.c:614 > > erofs_read_superblock fs/erofs/super.c:274 [inline] > > erofs_fc_fill_super+0x66a/0x2520 fs/erofs/super.c:614 > > vfs_get_super fs/super.c:1280 [inline] > > get_tree_nodev+0x183/0x350 fs/super.c:1299 > > erofs_fc_get_tree+0x34d/0x450 fs/erofs/super.c:721 > > vfs_get_tree+0xb1/0x5a0 fs/super.c:1814 > > do_new_mount+0x71f/0x15e0 fs/namespace.c:3507 > > path_mount+0x742/0x1f10 fs/namespace.c:3834 > > do_mount fs/namespace.c:3847 [inline] > > __do_sys_mount fs/namespace.c:4057 [inline] > > __se_sys_mount+0x722/0x810 fs/namespace.c:4034 > > __x64_sys_mount+0xe4/0x150 fs/namespace.c:4034 > > x64_sys_call+0x39bf/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:166 > > do_syscall_x64 arch/x86/entry/common.c:52 [inline] > > do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 > > entry_SYSCALL_64_after_hwframe+0x77/0x7f > > > > Uninit was created at: > > __alloc_pages_noprof+0x9a7/0xe00 mm/page_alloc.c:4776 > > alloc_pages_mpol_noprof+0x299/0x990 mm/mempolicy.c:2269 > > alloc_pages_noprof mm/mempolicy.c:2348 [inline] > > folio_alloc_noprof+0x1db/0x310 mm/mempolicy.c:2355 > > filemap_alloc_folio_noprof+0xa6/0x440 mm/filemap.c:1009 > > __filemap_get_folio+0xac4/0x1550 mm/filemap.c:1951 > > block_write_begin+0x6e/0x2b0 fs/buffer.c:2221 > > exfat_write_begin+0xfb/0x400 fs/exfat/inode.c:434 > > exfat_extend_valid_size fs/exfat/file.c:553 [inline] > > exfat_file_write_iter+0x771/0x12a0 fs/exfat/file.c:598 > > do_iter_readv_writev+0x88a/0xa30 > > vfs_writev+0x56a/0x14f0 fs/read_write.c:1050 > > do_pwritev fs/read_write.c:1146 [inline] > > __do_sys_pwritev2 fs/read_write.c:1204 [inline] > > __se_sys_pwritev2+0x262/0x460 fs/read_write.c:1195 > > __x64_sys_pwritev2+0x11f/0x1a0 fs/read_write.c:1195 > > x64_sys_call+0x368c/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:329 > > do_syscall_x64 arch/x86/entry/common.c:52 [inline] > > do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 > > entry_SYSCALL_64_after_hwframe+0x77/0x7f > > > > Currently, I don't think it's an EROFS issue but since it doesn't have > a valid reproducer so I don't have an exact idea. > > This case is out of EROFS file-backed mount, which seems to read EROFS > superblock (erofs_read_superblock -> erofs_read_metabuf -> erofs_bread) > via exfat page cache: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/erofs/super.c?h=v6.13-rc5#n274 > > But it seems exfat returns an unlocked uptodate page without fully > initialized data. > > I'm not sure if it's a post-EOF read for this specific regular inode, > but IMHO, at least mmap read allows post-EOF read within the same page, > so it'd be better to leave the whole page initialized on the exfat side. > > I'm not sure if it's related to exfat_extend_valid_size() though. > > Thanks, > Gao Xiang