udf: Verify symlink size before loading it
authorJan Kara <jack@suse.cz>
Fri, 19 Dec 2014 11:21:47 +0000 (12:21 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 20 Feb 2015 00:49:32 +0000 (00:49 +0000)
commitff19c553450f31186b7d1986d6de56ac130e54cd
treef96caa041a4301b5b61b38bb09b9ff48eb456633
parent24282850119ea4dc29afeb3b2e670f85a9755955
udf: Verify symlink size before loading it

commit a1d47b262952a45aae62bd49cfaf33dd76c11a2c upstream.

UDF specification allows arbitrarily large symlinks. However we support
only symlinks at most one block large. Check the length of the symlink
so that we don't access memory beyond end of the symlink block.

Reported-by: Carl Henrik Lunde <chlunde@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/udf/symlink.c