linux/fs/exfat
Yuezhang Mo 99f9a97dce exfat: add cluster chain loop check for dir
An infinite loop may occur if the following conditions occur due to
file system corruption.

(1) Condition for exfat_count_dir_entries() to loop infinitely.
    - The cluster chain includes a loop.
    - There is no UNUSED entry in the cluster chain.

(2) Condition for exfat_create_upcase_table() to loop infinitely.
    - The cluster chain of the root directory includes a loop.
    - There are no UNUSED entry and up-case table entry in the cluster
      chain of the root directory.

(3) Condition for exfat_load_bitmap() to loop infinitely.
    - The cluster chain of the root directory includes a loop.
    - There are no UNUSED entry and bitmap entry in the cluster chain
      of the root directory.

(4) Condition for exfat_find_dir_entry() to loop infinitely.
    - The cluster chain includes a loop.
    - The unused directory entries were exhausted by some operation.

(5) Condition for exfat_check_dir_empty() to loop infinitely.
    - The cluster chain includes a loop.
    - The unused directory entries were exhausted by some operation.
    - All files and sub-directories under the directory are deleted.

This commit adds checks to break the above infinite loop.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2025-08-01 08:34:23 +09:00
..
balloc.c exfat: support batch discard of clusters when freeing clusters 2025-03-27 21:18:02 +09:00
cache.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
dir.c exfat: add cluster chain loop check for dir 2025-08-01 08:34:23 +09:00
exfat_fs.h exfat: remove count used cluster from exfat_statfs() 2025-03-27 21:18:02 +09:00
exfat_raw.h
fatent.c exfat: add cluster chain loop check for dir 2025-08-01 08:34:23 +09:00
file.c exfat: fdatasync flag should be same like generic_write_sync() 2025-08-01 08:34:17 +09:00
inode.c fs: change write_begin/write_end interface to take struct kiocb * 2025-07-16 14:48:18 +02:00
Kconfig
Makefile
misc.c
namei.c exfat: add cluster chain loop check for dir 2025-08-01 08:34:23 +09:00
nls.c exfat: fix double free in delayed_free 2025-05-26 20:25:23 +09:00
super.c exfat: add cluster chain loop check for dir 2025-08-01 08:34:23 +09:00