* Patch "ext4: fix overflow caused by missing cast in ext4_resize_fs()" has been added to the 4.12-stable tree
@ 2017-08-07 21:50 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-08-07 21:50 UTC (permalink / raw)
To: jerrylee, gregkh, tytso; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
ext4: fix overflow caused by missing cast in ext4_resize_fs()
to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ext4-fix-overflow-caused-by-missing-cast-in-ext4_resize_fs.patch
and it can be found in the queue-4.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From aec51758ce10a9c847a62a48a168f8c804c6e053 Mon Sep 17 00:00:00 2001
From: Jerry Lee <jerrylee@qnap.com>
Date: Sun, 6 Aug 2017 01:18:31 -0400
Subject: ext4: fix overflow caused by missing cast in ext4_resize_fs()
From: Jerry Lee <jerrylee@qnap.com>
commit aec51758ce10a9c847a62a48a168f8c804c6e053 upstream.
On a 32-bit platform, the value of n_blcoks_count may be wrong during
the file system is resized to size larger than 2^32 blocks. This may
caused the superblock being corrupted with zero blocks count.
Fixes: 1c6bd7173d66
Signed-off-by: Jerry Lee <jerrylee@qnap.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext4/resize.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1927,7 +1927,8 @@ retry:
n_desc_blocks = o_desc_blocks +
le16_to_cpu(es->s_reserved_gdt_blocks);
n_group = n_desc_blocks * EXT4_DESC_PER_BLOCK(sb);
- n_blocks_count = n_group * EXT4_BLOCKS_PER_GROUP(sb);
+ n_blocks_count = (ext4_fsblk_t)n_group *
+ EXT4_BLOCKS_PER_GROUP(sb);
n_group--; /* set to last group number */
}
Patches currently in stable-queue which might be from jerrylee@qnap.com are
queue-4.12/ext4-fix-overflow-caused-by-missing-cast-in-ext4_resize_fs.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-07 21:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-07 21:50 Patch "ext4: fix overflow caused by missing cast in ext4_resize_fs()" has been added to the 4.12-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).