]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.7-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jul 2020 09:43:09 +0000 (11:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jul 2020 09:43:09 +0000 (11:43 +0200)
added patches:
exfat-fix-name_hash-computation-on-big-endian-systems.patch
exfat-fix-overflow-issue-in-exfat_cluster_to_sector.patch
exfat-fix-wrong-hint_stat-initialization-in-exfat_find_dir_entry.patch
exfat-fix-wrong-size-update-of-stream-entry-by-typo.patch

queue-5.7/exfat-fix-name_hash-computation-on-big-endian-systems.patch [new file with mode: 0644]
queue-5.7/exfat-fix-overflow-issue-in-exfat_cluster_to_sector.patch [new file with mode: 0644]
queue-5.7/exfat-fix-wrong-hint_stat-initialization-in-exfat_find_dir_entry.patch [new file with mode: 0644]
queue-5.7/exfat-fix-wrong-size-update-of-stream-entry-by-typo.patch [new file with mode: 0644]
queue-5.7/series

diff --git a/queue-5.7/exfat-fix-name_hash-computation-on-big-endian-systems.patch b/queue-5.7/exfat-fix-name_hash-computation-on-big-endian-systems.patch
new file mode 100644 (file)
index 0000000..06eeb25
--- /dev/null
@@ -0,0 +1,62 @@
+From db415f7aae07cadcabd5d2a659f8ad825c905299 Mon Sep 17 00:00:00 2001
+From: Ilya Ponetayev <i.ponetaev@ndmsystems.com>
+Date: Thu, 16 Jul 2020 17:27:53 +0900
+Subject: exfat: fix name_hash computation on big endian systems
+
+From: Ilya Ponetayev <i.ponetaev@ndmsystems.com>
+
+commit db415f7aae07cadcabd5d2a659f8ad825c905299 upstream.
+
+On-disk format for name_hash field is LE, so it must be explicitly
+transformed on BE system for proper result.
+
+Fixes: 370e812b3ec1 ("exfat: add nls operations")
+Cc: stable@vger.kernel.org # v5.7
+Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
+Signed-off-by: Ilya Ponetayev <i.ponetaev@ndmsystems.com>
+Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
+Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/exfat/nls.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/fs/exfat/nls.c
++++ b/fs/exfat/nls.c
+@@ -495,7 +495,7 @@ static int exfat_utf8_to_utf16(struct su
+               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);
+@@ -523,7 +523,7 @@ static int exfat_utf8_to_utf16(struct su
+                   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++;
+       }
+@@ -614,7 +614,7 @@ static int exfat_nls_to_ucs2(struct supe
+               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;
+@@ -628,7 +628,7 @@ static int exfat_nls_to_ucs2(struct supe
+                   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++;
+       }
diff --git a/queue-5.7/exfat-fix-overflow-issue-in-exfat_cluster_to_sector.patch b/queue-5.7/exfat-fix-overflow-issue-in-exfat_cluster_to_sector.patch
new file mode 100644 (file)
index 0000000..0684012
--- /dev/null
@@ -0,0 +1,34 @@
+From 43946b70494beefe40ec1b2ba4744c0f294d7736 Mon Sep 17 00:00:00 2001
+From: Namjae Jeon <namjae.jeon@samsung.com>
+Date: Fri, 3 Jul 2020 11:16:32 +0900
+Subject: exfat: fix overflow issue in exfat_cluster_to_sector()
+
+From: Namjae Jeon <namjae.jeon@samsung.com>
+
+commit 43946b70494beefe40ec1b2ba4744c0f294d7736 upstream.
+
+An overflow issue can occur while calculating sector in
+exfat_cluster_to_sector(). It needs to cast clus's type to sector_t
+before left shifting.
+
+Fixes: 1acf1a564b60 ("exfat: add in-memory and on-disk structures and headers")
+Cc: stable@vger.kernel.org # v5.7
+Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
+Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/exfat/exfat_fs.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/exfat/exfat_fs.h
++++ b/fs/exfat/exfat_fs.h
+@@ -375,7 +375,7 @@ static inline bool exfat_is_last_sector_
+ 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;
+ }
diff --git a/queue-5.7/exfat-fix-wrong-hint_stat-initialization-in-exfat_find_dir_entry.patch b/queue-5.7/exfat-fix-wrong-hint_stat-initialization-in-exfat_find_dir_entry.patch
new file mode 100644 (file)
index 0000000..a30114c
--- /dev/null
@@ -0,0 +1,33 @@
+From d2fa0c337d97a5490190b9f3b9c73c8f9f3602a1 Mon Sep 17 00:00:00 2001
+From: Namjae Jeon <namjae.jeon@samsung.com>
+Date: Fri, 3 Jul 2020 11:19:46 +0900
+Subject: exfat: fix wrong hint_stat initialization in exfat_find_dir_entry()
+
+From: Namjae Jeon <namjae.jeon@samsung.com>
+
+commit d2fa0c337d97a5490190b9f3b9c73c8f9f3602a1 upstream.
+
+We found the wrong hint_stat initialization in exfat_find_dir_entry().
+It should be initialized when cluster is EXFAT_EOF_CLUSTER.
+
+Fixes: ca06197382bd ("exfat: add directory operations")
+Cc: stable@vger.kernel.org # v5.7
+Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
+Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/exfat/dir.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/exfat/dir.c
++++ b/fs/exfat/dir.c
+@@ -1160,7 +1160,7 @@ found:
+                       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;
diff --git a/queue-5.7/exfat-fix-wrong-size-update-of-stream-entry-by-typo.patch b/queue-5.7/exfat-fix-wrong-size-update-of-stream-entry-by-typo.patch
new file mode 100644 (file)
index 0000000..cba829f
--- /dev/null
@@ -0,0 +1,32 @@
+From 41e3928f8c58184fcf0bb22e822af39a436370c7 Mon Sep 17 00:00:00 2001
+From: Hyeongseok Kim <hyeongseok@gmail.com>
+Date: Wed, 8 Jul 2020 18:52:33 +0900
+Subject: exfat: fix wrong size update of stream entry by typo
+
+From: Hyeongseok Kim <hyeongseok@gmail.com>
+
+commit 41e3928f8c58184fcf0bb22e822af39a436370c7 upstream.
+
+The stream.size field is updated to the value of create timestamp
+of the file entry. Fix this to use correct stream entry pointer.
+
+Fixes: 29bbb14bfc80 ("exfat: fix incorrect update of stream entry in __exfat_truncate()")
+Signed-off-by: Hyeongseok Kim <hyeongseok@gmail.com>
+Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/exfat/file.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/exfat/file.c
++++ b/fs/exfat/file.c
+@@ -175,7 +175,7 @@ int __exfat_truncate(struct inode *inode
+                       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) {
index 7964cc31e42cd4a316a0d59064044adde879e0ae..e7f9cb82e249cbbc64b79de802e09d311d696929 100644 (file)
@@ -24,3 +24,7 @@ drm-amd-display-add-dmcub-check-on-renoir.patch
 dm-mpath-pass-io-start-time-to-path-selector.patch
 dm-do-not-use-waitqueue-for-request-based-dm.patch
 sunrpc-reverting-d03727b248d0-nfsv4-fix-close-not-waiting-for-direct-io-compeletion.patch
+exfat-fix-overflow-issue-in-exfat_cluster_to_sector.patch
+exfat-fix-wrong-hint_stat-initialization-in-exfat_find_dir_entry.patch
+exfat-fix-wrong-size-update-of-stream-entry-by-typo.patch
+exfat-fix-name_hash-computation-on-big-endian-systems.patch