]> git.karo-electronics.de Git - linux-beck.git/commit
udf: Prevent stack overflow on corrupted filesystem mount
authorAlden Tondettar <alden.tondettar@gmail.com>
Tue, 26 Apr 2016 02:27:56 +0000 (19:27 -0700)
committerJan Kara <jack@suse.cz>
Tue, 26 Apr 2016 06:25:07 +0000 (08:25 +0200)
commita47241cdeee2689ee7089ec95cadfcf66588fbdb
tree78565c734b29f102c1d1350f71aae947cda8593e
parentc26f6c61578852f679787d555e6d07804e1f5f14
udf: Prevent stack overflow on corrupted filesystem mount

Presently, a corrupted or malicious UDF filesystem containing a very large
number (or cycle) of Logical Volume Integrity Descriptor extent
indirections may trigger a stack overflow and kernel panic in
udf_load_logicalvolint() on mount.

Replace the unnecessary recursion in udf_load_logicalvolint() with
simple iteration. Set an arbitrary limit of 1000 indirections (which would
have almost certainly overflowed the stack without this fix), and treat
such cases as if there were no LVID.

Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/super.c