Commit 41ae709d authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by Linus Torvalds

[PATCH] Insufficient validity check of fat_read_super() <2>

This patch add the validity check of 2 values (fats, reserved). These
values must not be 0.

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
parent 8851f5bb
...@@ -625,6 +625,18 @@ fat_read_super(struct super_block *sb, void *data, int silent, ...@@ -625,6 +625,18 @@ fat_read_super(struct super_block *sb, void *data, int silent,
} }
b = (struct fat_boot_sector *) bh->b_data; b = (struct fat_boot_sector *) bh->b_data;
if (!b->reserved) {
if (!silent)
printk("FAT: bogus number of reserved sectors\n");
brelse(bh);
goto out_invalid;
}
if (!b->fats) {
if (!silent)
printk("FAT: bogus number of FAT structure\n");
brelse(bh);
goto out_invalid;
}
if (!b->secs_track) { if (!b->secs_track) {
if (!silent) if (!silent)
printk("FAT: bogus sectors-per-track value\n"); printk("FAT: bogus sectors-per-track value\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment