Description for this pull request:

- fix overflow issue at sector calculation.
   - fix wrong hint_stat initialization.
   - fix wrong size update of stream entry.
   - fix endianness of upname in name_hash computation.
 -----BEGIN PGP SIGNATURE-----
 
 iQJMBAABCgA2FiEE6NzKS6Uv/XAAGHgyZwv7A1FEIQgFAl8Wb+0YHG5hbWphZS5q
 ZW9uQHNhbXN1bmcuY29tAAoJEGcL+wNRRCEIBM0P/Rh1JMylfsOfYsPKrr9ynAti
 FKmcY229ee88nh2s9T/Oci5UGWnTvtUNDymj25aiFgUGuSyn+ral4P7H4hnSMG34
 Sr5f/JNgblTZ4S1z89QGZrieSLcu/VV1l1nFXYEvCKNwjn+DIDvEx/V749joYZs4
 5rkbg0jY6gpSYQuYQGiHgcmnC1W3t2cMHxhUUZ0NntZZAZEe1FByNlabt0PtkRsK
 RjxFISHKG42xhv6ZL+jwLB351AEyYCb5nvirRYfNnTSWuV4EGh+dgCfsUs/b7yMe
 OoQ99D1HYecKpCy3GzvAPH+IwFGfR0yLktepHqI9nvpNwoW/er2wSS1hkk2hRWYW
 CeZgIZOLSECu2Ctu6Aum6xSOHyuckN+GJ+YcknzgoFa91iXf6OTRvBYjAEeg3RjO
 MJ2rtk61NzgZqXjA4PO/naYOebl9JEtI6RKeO7VQT0I+h2v9x6ix4uLAcr2S9Jn7
 zzXHbW/4tzdxG+KVcVSttAU3j1UAu0zCT8UQihQm9fGadwZMJUEQAYJGIHd9zUlj
 nrxCCnn7ZorOCUOMHGJbL9QRu137WNhQ04698bw/EA71Cweq8HMOhmttLdecJCG1
 ikNDdM95XbkZC8arSORQFuyAzQDP1IiFsZOJZTQJmiq1aNCHCJwsT+oAr+ruqeTW
 1WJGbwNzjTB3fo6jRZ7U
 =g1HI
 -----END PGP SIGNATURE-----

Merge tag 'exfat-for-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat into master

Pull exfat fixes from Namjae Jeon:

 - fix overflow issue at sector calculation

 - fix wrong hint_stat initialization

 - fix wrong size update of stream entry

 - fix endianness of upname in name_hash computation

* tag 'exfat-for-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
  exfat: fix name_hash computation on big endian systems
  exfat: fix wrong size update of stream entry by typo
  exfat: fix wrong hint_stat initialization in exfat_find_dir_entry()
  exfat: fix overflow issue in exfat_cluster_to_sector()
This commit is contained in:
Linus Torvalds 2020-07-22 11:30:07 -07:00
commit 071fb1bcd7
4 changed files with 7 additions and 7 deletions

View File

@ -1112,7 +1112,7 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
ret = exfat_get_next_cluster(sb, &clu.dir);
}
if (ret || clu.dir != EXFAT_EOF_CLUSTER) {
if (ret || clu.dir == EXFAT_EOF_CLUSTER) {
/* just initialized hint_stat */
hint_stat->clu = p_dir->dir;
hint_stat->eidx = 0;

View File

@ -371,7 +371,7 @@ static inline bool exfat_is_last_sector_in_cluster(struct exfat_sb_info *sbi,
static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi,
unsigned int clus)
{
return ((clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) +
return ((sector_t)(clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) +
sbi->data_start_sector;
}

View File

@ -176,7 +176,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size)
ep2->dentry.stream.size = 0;
} else {
ep2->dentry.stream.valid_size = cpu_to_le64(new_size);
ep2->dentry.stream.size = ep->dentry.stream.valid_size;
ep2->dentry.stream.size = ep2->dentry.stream.valid_size;
}
if (new_size == 0) {

View File

@ -495,7 +495,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
struct exfat_uni_name *p_uniname, int *p_lossy)
{
int i, unilen, lossy = NLS_NAME_NO_LOSSY;
unsigned short upname[MAX_NAME_LENGTH + 1];
__le16 upname[MAX_NAME_LENGTH + 1];
unsigned short *uniname = p_uniname->name;
WARN_ON(!len);
@ -519,7 +519,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
exfat_wstrchr(bad_uni_chars, *uniname))
lossy |= NLS_NAME_LOSSY;
upname[i] = exfat_toupper(sb, *uniname);
upname[i] = cpu_to_le16(exfat_toupper(sb, *uniname));
uniname++;
}
@ -597,7 +597,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb,
struct exfat_uni_name *p_uniname, int *p_lossy)
{
int i = 0, unilen = 0, lossy = NLS_NAME_NO_LOSSY;
unsigned short upname[MAX_NAME_LENGTH + 1];
__le16 upname[MAX_NAME_LENGTH + 1];
unsigned short *uniname = p_uniname->name;
struct nls_table *nls = EXFAT_SB(sb)->nls_io;
@ -611,7 +611,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb,
exfat_wstrchr(bad_uni_chars, *uniname))
lossy |= NLS_NAME_LOSSY;
upname[unilen] = exfat_toupper(sb, *uniname);
upname[unilen] = cpu_to_le16(exfat_toupper(sb, *uniname));
uniname++;
unilen++;
}