summaryrefslogtreecommitdiffstats
path: root/patches/cve/CVE-2018-10879-ext4-make-sure-bitmaps-and-the-inode-table-don-t-ove.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/cve/CVE-2018-10879-ext4-make-sure-bitmaps-and-the-inode-table-don-t-ove.patch')
-rw-r--r--patches/cve/CVE-2018-10879-ext4-make-sure-bitmaps-and-the-inode-table-don-t-ove.patch83
1 files changed, 0 insertions, 83 deletions
diff --git a/patches/cve/CVE-2018-10879-ext4-make-sure-bitmaps-and-the-inode-table-don-t-ove.patch b/patches/cve/CVE-2018-10879-ext4-make-sure-bitmaps-and-the-inode-table-don-t-ove.patch
deleted file mode 100644
index 439c9e9..0000000
--- a/patches/cve/CVE-2018-10879-ext4-make-sure-bitmaps-and-the-inode-table-don-t-ove.patch
+++ /dev/null
@@ -1,83 +0,0 @@
1From 77260807d1170a8cf35dbb06e07461a655f67eee Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Wed, 13 Jun 2018 23:08:26 -0400
4Subject: [PATCH] ext4: make sure bitmaps and the inode table don't overlap
5 with bg descriptors
6
7It's really bad when the allocation bitmaps and the inode table
8overlap with the block group descriptors, since it causes random
9corruption of the bg descriptors. So we really want to head those off
10at the pass.
11
12https://bugzilla.kernel.org/show_bug.cgi?id=199865
13
14CVE: CVE-2018-10879
15Upstream-Status: Backport
16
17Signed-off-by: Theodore Ts'o <tytso@mit.edu>
18Cc: stable@kernel.org
19Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
20---
21 fs/ext4/super.c | 25 +++++++++++++++++++++++++
22 1 file changed, 25 insertions(+)
23
24diff --git a/fs/ext4/super.c b/fs/ext4/super.c
25index c8b7b83..c61675d 100644
26--- a/fs/ext4/super.c
27+++ b/fs/ext4/super.c
28@@ -2348,6 +2348,7 @@ static int ext4_check_descriptors(struct super_block *sb,
29 struct ext4_sb_info *sbi = EXT4_SB(sb);
30 ext4_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block);
31 ext4_fsblk_t last_block;
32+ ext4_fsblk_t last_bg_block = sb_block + ext4_bg_num_gdb(sb, 0) + 1;
33 ext4_fsblk_t block_bitmap;
34 ext4_fsblk_t inode_bitmap;
35 ext4_fsblk_t inode_table;
36@@ -2380,6 +2381,14 @@ static int ext4_check_descriptors(struct super_block *sb,
37 if (!sb_rdonly(sb))
38 return 0;
39 }
40+ if (block_bitmap >= sb_block + 1 &&
41+ block_bitmap <= last_bg_block) {
42+ ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: "
43+ "Block bitmap for group %u overlaps "
44+ "block group descriptors", i);
45+ if (!sb_rdonly(sb))
46+ return 0;
47+ }
48 if (block_bitmap < first_block || block_bitmap > last_block) {
49 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: "
50 "Block bitmap for group %u not in group "
51@@ -2394,6 +2403,14 @@ static int ext4_check_descriptors(struct super_block *sb,
52 if (!sb_rdonly(sb))
53 return 0;
54 }
55+ if (inode_bitmap >= sb_block + 1 &&
56+ inode_bitmap <= last_bg_block) {
57+ ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: "
58+ "Inode bitmap for group %u overlaps "
59+ "block group descriptors", i);
60+ if (!sb_rdonly(sb))
61+ return 0;
62+ }
63 if (inode_bitmap < first_block || inode_bitmap > last_block) {
64 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: "
65 "Inode bitmap for group %u not in group "
66@@ -2408,6 +2425,14 @@ static int ext4_check_descriptors(struct super_block *sb,
67 if (!sb_rdonly(sb))
68 return 0;
69 }
70+ if (inode_table >= sb_block + 1 &&
71+ inode_table <= last_bg_block) {
72+ ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: "
73+ "Inode table for group %u overlaps "
74+ "block group descriptors", i);
75+ if (!sb_rdonly(sb))
76+ return 0;
77+ }
78 if (inode_table < first_block ||
79 inode_table + sbi->s_itb_per_group - 1 > last_block) {
80 ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: "
81--
822.7.4
83