[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220926100808.419018985@linuxfoundation.org>
Date: Mon, 26 Sep 2022 12:10:29 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Yuezhang Mo <Yuezhang.Mo@...y.com>,
Andy Wu <Andy.Wu@...y.com>,
Aoyama Wataru <wataru.aoyama@...y.com>,
Sungjong Seo <sj1557.seo@...sung.com>,
Namjae Jeon <linkinjeon@...nel.org>
Subject: [PATCH 5.19 040/207] exfat: fix overflow for large capacity partition
From: Yuezhang Mo <Yuezhang.Mo@...y.com>
commit 2e9ceb6728f1dc2fa4b5d08f37d88cbc49a20a62 upstream.
Using int type for sector index, there will be overflow in a large
capacity partition.
For example, if storage with sector size of 512 bytes and partition
capacity is larger than 2TB, there will be overflow.
Fixes: 1b6138385499 ("exfat: reduce block requests when zeroing a cluster")
Cc: stable@...r.kernel.org # v5.19+
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@...y.com>
Reviewed-by: Andy Wu <Andy.Wu@...y.com>
Reviewed-by: Aoyama Wataru <wataru.aoyama@...y.com>
Acked-by: Sungjong Seo <sj1557.seo@...sung.com>
Signed-off-by: Namjae Jeon <linkinjeon@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/exfat/fatent.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index ee0b7cf51157..41ae4cce1f42 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -270,8 +270,7 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu)
struct super_block *sb = dir->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb);
struct buffer_head *bh;
- sector_t blknr, last_blknr;
- int i;
+ sector_t blknr, last_blknr, i;
blknr = exfat_cluster_to_sector(sbi, clu);
last_blknr = blknr + sbi->sect_per_clus;
--
2.37.3
Powered by blists - more mailing lists