Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 910bb12d authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

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: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 987c7c31
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -644,6 +644,8 @@ static struct inode *f2fs_nfs_get_inode(struct super_block *sb,


	if (unlikely(ino < F2FS_ROOT_INO(sbi)))
	if (unlikely(ino < F2FS_ROOT_INO(sbi)))
		return ERR_PTR(-ESTALE);
		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!
	 * f2fs_iget isn't quite right if the inode is currently unallocated!