Whamcloud - gitweb
libext2fs: enforce a max nested link count in ext2fs_find_block_device()
authorNiu Yawei <niu@whamcloud.com>
Sun, 20 Nov 2011 04:08:03 +0000 (23:08 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 20 Nov 2011 04:11:20 +0000 (23:11 -0500)
commit08ae93a2eda03817deabf08d4da9015a283ed56b
tree6eae7f64b209021229be882aa26c0186fb81cf0b
parent19ef479acf566343b277be3554beda7e1f400381
libext2fs: enforce a max nested link count in ext2fs_find_block_device()

Define EXT2FS_MAX_NESTED_LINKS as 8, and check the link count to make
sure we don't exceed it in ext2fs_find_block_device() and
follow_link().  This fixes a potential infinite loop in
ext2fs_find_block_device() if there are symbolic loop links in the
device directory.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext2fsP.h
lib/ext2fs/finddev.c
lib/ext2fs/namei.c