]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
udf: Check path length when reading symlink
authorJan Kara <jack@suse.cz>
Thu, 18 Dec 2014 21:37:50 +0000 (22:37 +0100)
committerZefan Li <lizefan@huawei.com>
Tue, 14 Apr 2015 09:33:48 +0000 (17:33 +0800)
commit99961be4f571a89b2213d459ec2b970b99839654
tree2d1858cc0cff2029d6767058882528c0e1870479
parentfb1b20745fd0ac7a7c48f589842e70225bae1426
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>
[lizf: Backported to 3.4: udf_get_filename() is called in do_udf_readdir()]
Signed-off-by: Zefan Li <lizefan@huawei.com>
fs/udf/dir.c
fs/udf/namei.c
fs/udf/symlink.c
fs/udf/udfdecl.h
fs/udf/unicode.c