diff --git a/[refs] b/[refs] index 4af5926069ec..1c8487aec44e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bf52c6f7af55c48ab0fd5f990460b884b428d906 +refs/heads/master: 8762202dd0d6e46854f786bdb6fb3780a1625efe diff --git a/trunk/fs/jbd/journal.c b/trunk/fs/jbd/journal.c index 9fe061fb8779..fea8dd661d2b 100644 --- a/trunk/fs/jbd/journal.c +++ b/trunk/fs/jbd/journal.c @@ -1135,6 +1135,14 @@ static int journal_get_superblock(journal_t *journal) goto out; } + if (be32_to_cpu(sb->s_first) == 0 || + be32_to_cpu(sb->s_first) >= journal->j_maxlen) { + printk(KERN_WARNING + "JBD: Invalid start block of journal: %u\n", + be32_to_cpu(sb->s_first)); + goto out; + } + return 0; out: diff --git a/trunk/fs/jbd2/journal.c b/trunk/fs/jbd2/journal.c index f24df13adc4e..d6e93d00833e 100644 --- a/trunk/fs/jbd2/journal.c +++ b/trunk/fs/jbd2/journal.c @@ -1251,6 +1251,14 @@ static int journal_get_superblock(journal_t *journal) goto out; } + if (be32_to_cpu(sb->s_first) == 0 || + be32_to_cpu(sb->s_first) >= journal->j_maxlen) { + printk(KERN_WARNING + "JBD2: Invalid start block of journal: %u\n", + be32_to_cpu(sb->s_first)); + goto out; + } + return 0; out: