diff options
author | Christophe Grenier <grenier@cgsecurity.org> | 2013-07-30 10:52:21 +0200 |
---|---|---|
committer | Christophe Grenier <grenier@cgsecurity.org> | 2013-07-30 10:52:21 +0200 |
commit | 436dee516cf4c2683b51932a6f714d52e273dfde (patch) | |
tree | 7a9241007911fe15b7de123764e737d0d9810fb3 /src/jfs.c | |
parent | c711ef6587069238c8515f7123eb32ad824e932b (diff) |
JFS filesystem: check blocksize
Diffstat (limited to 'src/jfs.c')
-rw-r--r-- | src/jfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -105,6 +105,10 @@ static int test_JFS(disk_t *disk_car, const struct jfs_superblock *sb, partition { if(memcmp(sb->s_magic,"JFS1",4)!=0) return 1; + /* Blocksize must be a multiple of 512 */ + if(le32(sb->s_bsize)<512 || + ((le32(sb->s_bsize)-1) & le32(sb->s_bsize))!=0) + return 1; if(dump_ind!=0) { log_info("\nJFS magic value at %u/%u/%u\n", offset2cylinder(disk_car,partition->part_offset),offset2head(disk_car,partition->part_offset),offset2sector(disk_car,partition->part_offset)); |