linux-yocto/fs/exfat
Yuezhang Mo af089264d1 exfat: fix the infinite loop in exfat_find_last_cluster()
[ Upstream commit b0522303f6 ]

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:37:35 +02:00
..
balloc.c exfat: fix soft lockup in exfat_clear_bitmap 2025-03-13 12:58:32 +01:00
cache.c exfat: fix use of uninitialized spinlock on error path 2020-10-07 14:27:13 +09:00
dir.c exfat: fix the infinite loop in exfat_readdir() 2025-01-17 13:36:10 +01:00
exfat_fs.h exfat: fix soft lockup in exfat_clear_bitmap 2025-03-13 12:58:32 +01:00
exfat_raw.h exfat: handle unreconized benign secondary entries 2023-02-27 21:14:46 +09:00
fatent.c exfat: fix the infinite loop in exfat_find_last_cluster() 2025-04-10 14:37:35 +02:00
file.c fs: pass the request_mask to generic_fillattr 2023-08-09 08:56:36 +02:00
inode.c exfat: convert to ctime accessor functions 2023-07-13 10:28:07 +02:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile exfat: add Kconfig and Makefile 2020-03-05 21:00:40 -05:00
misc.c exfat: Expand exfat_err() and co directly to pr_*() macro 2022-08-01 10:14:07 +09:00
namei.c exfat: fix uninit-value in __exfat_get_dentry_set 2024-12-09 10:32:45 +01:00
nls.c exfat: Drop superfluous new line for error messages 2022-08-01 10:14:07 +09:00
super.c v6.6-vfs.super 2023-08-28 11:04:18 -07:00