sst-linux/fs/exfat
Yuezhang Mo 83048539a7 exfat: fix the infinite loop in exfat_find_last_cluster()
[ Upstream commit b0522303f67255926b946aa66885a0104d1b2980 ]

In exfat_find_last_cluster(), the cluster chain is traversed until
the EOF cluster. If the cluster chain includes a loop due to file
system corruption, the EOF cluster cannot be traversed, resulting
in an infinite loop.

If the number of clusters indicated by the file size is inconsistent
with the cluster chain length, exfat_find_last_cluster() will return
an error, so if this inconsistency is found, the traversal can be
aborted without traversing to the EOF cluster.

Reported-by: syzbot+f7d147e6db52b1e09dba@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f7d147e6db52b1e09dba
Tested-by: syzbot+f7d147e6db52b1e09dba@syzkaller.appspotmail.com
Fixes: 31023864e6 ("exfat: add fat entry operations")
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-10 14:33:37 +02:00
..
balloc.c exfat: fix soft lockup in exfat_clear_bitmap 2025-03-13 12:53:18 +01:00
cache.c
dir.c exfat: fix the infinite loop in exfat_readdir() 2025-01-17 13:34:37 +01:00
exfat_fs.h exfat: fix soft lockup in exfat_clear_bitmap 2025-03-13 12:53:18 +01:00
exfat_raw.h
fatent.c exfat: fix the infinite loop in exfat_find_last_cluster() 2025-04-10 14:33:37 +02:00
file.c
inode.c
Kconfig
Makefile
misc.c
namei.c exfat: fix uninit-value in __exfat_get_dentry_set 2024-12-14 19:54:00 +01:00
nls.c
super.c