aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-03-12 17:08:36 +0800
committerAndreas Blaesius <skate4life@gmx.de>2016-06-05 21:21:20 +0200
commitbe25c4537b5c020996b57756f7bcccb7d9e80c93 (patch)
treef74fab68d3fb58646198ad4843240cff83fe87f8 /fs
parent1596ac387b62f975ae848b20e33da0752fca5cdf (diff)
downloadkernel_samsung_espresso10-be25c4537b5c020996b57756f7bcccb7d9e80c93.zip
kernel_samsung_espresso10-be25c4537b5c020996b57756f7bcccb7d9e80c93.tar.gz
kernel_samsung_espresso10-be25c4537b5c020996b57756f7bcccb7d9e80c93.tar.bz2
f2fs: check upper bound of ino value in f2fs_nfs_get_inode
Upper bound checking of ino should be added to f2fs_nfs_get_inode, so unneeded process before do_read_inode in f2fs_iget could be avoided when ino is invalid. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index bf11740..d1ffa87 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -626,6 +626,8 @@ static struct inode *f2fs_nfs_get_inode(struct super_block *sb,
if (unlikely(ino < F2FS_ROOT_INO(sbi)))
return ERR_PTR(-ESTALE);
+ if (unlikely(ino >= NM_I(sbi)->max_nid))
+ return ERR_PTR(-ESTALE);
/*
* f2fs_iget isn't quite right if the inode is currently unallocated!