]> git.baikalelectronics.ru Git - kernel.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)
commitd9366b3bcd49d1c1c8bd262875cde397e2c37b7e
tree78565c734b29f102c1d1350f71aae947cda8593e
parentb9a98a037c2feda86d87afec55fd679cf7c3a37b
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