udf: Check component length before reading it
authorJan Kara <jack@suse.cz>
Fri, 19 Dec 2014 13:27:55 +0000 (14:27 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 20 Feb 2015 00:49:32 +0000 (00:49 +0000)
commit1e21fa3ab68b261aa6086c49567963f6f3ad87b9
tree8580307c2d0ebf6a9b46f195bacab12cff885f4d
parentba4055175ea39c9f0c16da025c908d3049d2f791
udf: Check component length before reading it

commit e237ec37ec154564f8690c5bd1795339955eeef9 upstream.

Check that length specified in a component of a symlink fits in the
input buffer we are reading. Also properly ignore component length for
component types that do not use it. Otherwise we read memory after end
of buffer for corrupted udf image.

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