diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jbd/journal.c | 8 | ||||
-rw-r--r-- | fs/jbd2/journal.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 9fe061fb8779..fea8dd661d2b 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -1135,6 +1135,14 @@ static int journal_get_superblock(journal_t *journal) | |||
1135 | goto out; | 1135 | goto out; |
1136 | } | 1136 | } |
1137 | 1137 | ||
1138 | if (be32_to_cpu(sb->s_first) == 0 || | ||
1139 | be32_to_cpu(sb->s_first) >= journal->j_maxlen) { | ||
1140 | printk(KERN_WARNING | ||
1141 | "JBD: Invalid start block of journal: %u\n", | ||
1142 | be32_to_cpu(sb->s_first)); | ||
1143 | goto out; | ||
1144 | } | ||
1145 | |||
1138 | return 0; | 1146 | return 0; |
1139 | 1147 | ||
1140 | out: | 1148 | out: |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index f24df13adc4e..d6e93d00833e 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -1251,6 +1251,14 @@ static int journal_get_superblock(journal_t *journal) | |||
1251 | goto out; | 1251 | goto out; |
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | if (be32_to_cpu(sb->s_first) == 0 || | ||
1255 | be32_to_cpu(sb->s_first) >= journal->j_maxlen) { | ||
1256 | printk(KERN_WARNING | ||
1257 | "JBD2: Invalid start block of journal: %u\n", | ||
1258 | be32_to_cpu(sb->s_first)); | ||
1259 | goto out; | ||
1260 | } | ||
1261 | |||
1254 | return 0; | 1262 | return 0; |
1255 | 1263 | ||
1256 | out: | 1264 | out: |