diff options
author | Bob Copeland <me@bobcopeland.com> | 2008-09-06 17:51:53 -0400 |
---|---|---|
committer | Bob Copeland <me@bobcopeland.com> | 2010-07-10 14:37:06 -0400 |
commit | f068272cb2f134a194b93e94a8e0672bfce48cd8 (patch) | |
tree | c6a2a67951646eee3d040b732b384fa5c98fe78c /fs/omfs/omfs.h | |
parent | 70d9e384aa7df681cfffd65947af72b22e86690e (diff) |
omfs: check bounds on block numbers before passing to sb_bread
In case of filesystem corruption, passing unchecked block numbers into
sb_bread can result in an infinite loop in __getblk(). Introduce a wrapper
function omfs_sbread() to check the block numbers and to also perform the
clus_to_blk() scaling.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Diffstat (limited to 'fs/omfs/omfs.h')
-rw-r--r-- | fs/omfs/omfs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/omfs/omfs.h b/fs/omfs/omfs.h index ebe2fdbe535e..7d414fef501a 100644 --- a/fs/omfs/omfs.h +++ b/fs/omfs/omfs.h | |||
@@ -58,6 +58,7 @@ extern void omfs_make_empty_table(struct buffer_head *bh, int offset); | |||
58 | extern int omfs_shrink_inode(struct inode *inode); | 58 | extern int omfs_shrink_inode(struct inode *inode); |
59 | 59 | ||
60 | /* inode.c */ | 60 | /* inode.c */ |
61 | extern struct buffer_head *omfs_bread(struct super_block *sb, sector_t block); | ||
61 | extern struct inode *omfs_iget(struct super_block *sb, ino_t inode); | 62 | extern struct inode *omfs_iget(struct super_block *sb, ino_t inode); |
62 | extern struct inode *omfs_new_inode(struct inode *dir, int mode); | 63 | extern struct inode *omfs_new_inode(struct inode *dir, int mode); |
63 | extern int omfs_reserve_block(struct super_block *sb, sector_t block); | 64 | extern int omfs_reserve_block(struct super_block *sb, sector_t block); |