udf: Check path length when reading symlink
authorJan Kara <jack@suse.cz>
Thu, 18 Dec 2014 21:37:50 +0000 (22:37 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 20 Feb 2015 00:49:32 +0000 (00:49 +0000)
commitfbdbac7bd9def21be7ac4e680c25d880661c10d9
tree65e9322effca1c2947bc66e7b9f6d90003bbc08c
parent6276a08d7cbf88840ea02f0ea2fb73e0db1c49eb
udf: Check path length when reading symlink

commit 0e5cc9a40ada6046e6bc3bdfcd0c0d7e4b706b14 upstream.

Symlink reading code does not check whether the resulting path fits into
the page provided by the generic code. This isn't as easy as just
checking the symlink size because of various encoding conversions we
perform on path. So we have to check whether there is still enough space
in the buffer on the fly.

Reported-by: Carl Henrik Lunde <chlunde@ping.uio.no>
Signed-off-by: Jan Kara <jack@suse.cz>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/udf/dir.c
fs/udf/namei.c
fs/udf/symlink.c
fs/udf/udfdecl.h
fs/udf/unicode.c