Commit 50fda57
committed
ext4: avoid resizing to a partial cluster size
jira VULN-135014
cve CVE-2022-50020
commit-author Kiselev, Oleg <okiselev@amazon.com>
commit 69cb8e9
upstream-diff This kernel doesn't have the ext4_feature_has_bigalloc
helper, so this commit uses the EXT4_HAS_RO_COMPAT_FEATURE
macro which does the same thing
This patch avoids an attempt to resize the filesystem to an
unaligned cluster boundary. An online resize to a size that is not
integral to cluster size results in the last iteration attempting to
grow the fs by a negative amount, which trips a BUG_ON and leaves the fs
with a corrupted in-memory superblock.
Signed-off-by: Oleg Kiselev <okiselev@amazon.com>
Link: https://lore.kernel.org/r/0E92A0AB-4F16-4F1A-94B7-702CC6504FDE@amazon.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 69cb8e9)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>1 parent d4221b3 commit 50fda57
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1900 | 1900 | | |
1901 | 1901 | | |
1902 | 1902 | | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
1903 | 1913 | | |
1904 | 1914 | | |
1905 | 1915 | | |
| |||
0 commit comments