#syz test
From e89c336b835e5b9170b518cf5eea98ea53f49f4b Mon Sep 17 00:00:00 2001
From: Yuezhang Mo <Yuezhang.Mo@xxxxxxxx>
Date: Thu, 12 Dec 2024 11:15:37 +0800
Subject: [PATCH v1] exfat: add loop chek for the cluster chain of root
---
fs/exfat/fatent.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index 5d8b7413d80d..0b49e6878222 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -455,6 +455,9 @@ int exfat_count_num_clusters(struct super_block *sb,
break;
}
+ if (i == sbi->num_clusters)
+ return -EIO;
+
*ret_count = count;
return 0;
}
--
2.43.0