]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Aug 2016 07:33:18 +0000 (09:33 +0200)
commit1e80f40d42ea6e567346b9ae28d7f07a8b9dee0c
treea98fc45b0f63bf9bff499f17bc94c2707d3e0cfd
parent1537fac950d225042fb88e23e62320f63ee5e9d0
udf: Prevent stack overflow on corrupted filesystem mount

commit a47241cdeee2689ee7089ec95cadfcf66588fbdb upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/super.c