summaryrefslogtreecommitdiffstats
path: root/fs/udf/namei.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2014-12-18 22:37:50 +0100
committerJan Kara <jack@suse.cz>2014-12-19 14:12:08 +0100
commit0e5cc9a40ada6046e6bc3bdfcd0c0d7e4b706b14 (patch)
tree6a9a8bef5942cb6b18ae977fd1be24c59cebe71c /fs/udf/namei.c
parenta1d47b262952a45aae62bd49cfaf33dd76c11a2c (diff)
downloadlinux-0e5cc9a40ada6046e6bc3bdfcd0c0d7e4b706b14.tar.gz
linux-0e5cc9a40ada6046e6bc3bdfcd0c0d7e4b706b14.tar.bz2
linux-0e5cc9a40ada6046e6bc3bdfcd0c0d7e4b706b14.zip
udf: Check path length when reading symlink
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. CC: stable@vger.kernel.org Reported-by: Carl Henrik Lunde <chlunde@ping.uio.no> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r--fs/udf/namei.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index c12e260fd6c4..6ff19b54b51f 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -233,7 +233,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir,
if (!lfi)
continue;
- flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi);
+ flen = udf_get_filename(dir->i_sb, nameptr, lfi, fname,
+ UDF_NAME_LEN);
if (flen && udf_match(flen, fname, child->len, child->name))
goto out_ok;
}