mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-13 03:44:57 +08:00
debugfs: add journal header checks in logdump
Addresses-Coverity-Bug: 1431466 Addresses-Coverity-Bug: 1432478 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
10f9b11b76
commit
bd9ac48c92
@ -406,7 +406,12 @@ static void dump_journal(char *cmdname, FILE *out_file,
|
||||
"Journal superblock magic number invalid!\n");
|
||||
return;
|
||||
}
|
||||
blocksize = be32_to_cpu(jsb->s_blocksize);
|
||||
if (be32_to_cpu(jsb->s_blocksize) != blocksize) {
|
||||
fprintf(out_file,
|
||||
"Journal block size invalid: %u\n",
|
||||
be32_to_cpu(jsb->s_blocksize));
|
||||
return;
|
||||
}
|
||||
transaction = be32_to_cpu(jsb->s_sequence);
|
||||
blocknr = be32_to_cpu(jsb->s_start);
|
||||
|
||||
@ -690,6 +695,11 @@ static void dump_revoke_block(FILE *out_file, char *buf,
|
||||
header = (jbd2_journal_revoke_header_t *) buf;
|
||||
offset = sizeof(jbd2_journal_revoke_header_t);
|
||||
max = be32_to_cpu(header->r_count);
|
||||
if (max > jsb->s_blocksize) {
|
||||
fprintf(out_file, "Revoke block's r_count invalid: %u\b",
|
||||
max);
|
||||
max = jsb->s_blocksize;
|
||||
}
|
||||
|
||||
while (offset < max) {
|
||||
if (tag_size == sizeof(__u32)) {
|
||||
|
Loading…
Reference in New Issue
Block a user