BACKPORT: udf: Check path length when reading symlink

BACKPORT NOTE: Minor conflict in fs/udf/dir.c

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.

BUG=b:63333486
TEST=None

CC: stable@vger.kernel.org
Reported-by: Carl Henrik Lunde <chlunde@ping.uio.no>
Signed-off-by: Jan Kara <jack@suse.cz>
(cherry picked from commit 0e5cc9a40ada6046e6bc3bdfcd0c0d7e4b706b14)
Signed-off-by: Bernie Thompson <bhthompson@google.com>

Change-Id: I8b271de6c33cf043407e1989ff7d9f639de1945c
Reviewed-on: https://chromium-review.googlesource.com/560023
Commit-Ready: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
5 files changed