Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>2002-02-20 20:23:29 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-02-20 20:23:29 -0800
commit41ae709dd601ac80847dc26d779d2403f3a56ed5 (patch)
tree4ad17e35639a4bdad05c48cd6a9913f2598f8db2
parent8851f5bbaa6692b29fd20dfaad6c8e52dd9ba8b4 (diff)
[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>
-rw-r--r--fs/fat/inode.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 0b292b3562ff..73859637332d 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -625,6 +625,18 @@ fat_read_super(struct super_block *sb, void *data, int silent,
}
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 (!silent)
printk("FAT: bogus sectors-per-track value\n");