[<prev] [next>] [day] [month] [year] [list]
Message-ID: <PUZPR04MB63164078AA37CA1A2BCF159881E39@PUZPR04MB6316.apcprd04.prod.outlook.com>
Date: Tue, 13 Dec 2022 02:37:08 +0000
From: "Yuezhang.Mo@...y.com" <Yuezhang.Mo@...y.com>
To: "sj1557.seo@...sung.com" <sj1557.seo@...sung.com>,
"linkinjeon@...nel.org" <linkinjeon@...nel.org>
CC: "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Andy.Wu@...y.com" <Andy.Wu@...y.com>,
"Wataru.Aoyama@...y.com" <Wataru.Aoyama@...y.com>
Subject: [PATCH v2 6/7] exfat: fix overflow in sector and cluster conversion
According to the exFAT specification, there are at most 2^32-11
clusters in a volume. so using 'int' is not enough for cluster
index, the return value type of exfat_sector_to_cluster() should
be 'unsigned int'.
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@...y.com>
---
fs/exfat/exfat_fs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
index a1e7feb22079..bc6d21d7c5ad 100644
--- a/fs/exfat/exfat_fs.h
+++ b/fs/exfat/exfat_fs.h
@@ -400,7 +400,7 @@ static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi,
sbi->data_start_sector;
}
-static inline int exfat_sector_to_cluster(struct exfat_sb_info *sbi,
+static inline unsigned int exfat_sector_to_cluster(struct exfat_sb_info *sbi,
sector_t sec)
{
return ((sec - sbi->data_start_sector) >> sbi->sect_per_clus_bits) +
--
2.25.1
Powered by blists - more mailing lists