1
0
Fork 0
remarkable-linux/fs/udf
Andrew Gabbasov 516a102b0a udf: Check output buffer length when converting name to CS0
[ Upstream commit bb00c898ad ]

If a name contains at least some characters with Unicode values
exceeding single byte, the CS0 output should have 2 bytes per character.
And if other input characters have single byte Unicode values, then
the single input byte is converted to 2 output bytes, and the length
of output becomes larger than the length of input. And if the input
name is long enough, the output length may exceed the allocated buffer
length.

All this means that conversion from UTF8 or NLS to CS0 requires
checking of output length in order to stop when it exceeds the given
output buffer size.

[JK: Make code return -ENAMETOOLONG instead of silently truncating the
name]

CC: stable@vger.kernel.org
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-02-01 14:54:15 -05:00
..
Kconfig udf: Update Kconfig description 2015-01-05 11:04:37 +01:00
Makefile switch udf to simple_fsync() 2009-06-11 21:36:13 -04:00
balloc.c udf: use int for allocated blocks instead of sector_t 2015-03-16 08:24:16 +01:00
dir.c udf: remove redundant buffer_head.h includes 2015-03-14 07:54:02 +01:00
directory.c udf: remove redundant buffer_head.h includes 2015-03-14 07:54:02 +01:00
ecma_167.h Remove struct typedefs from fs/udf/ecma_167.h et al. 2009-04-02 12:29:47 +02:00
file.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
ialloc.c udf: saner calling conventions for udf_new_inode() 2014-09-04 21:37:41 +02:00
inode.c udf: limit the maximum number of indirect extents in a row 2016-02-01 12:39:42 -05:00
lowlevel.c udf: use linux/uaccess.h 2014-07-15 22:40:23 +02:00
misc.c udf: remove redundant buffer_head.h includes 2015-03-14 07:54:02 +01:00
namei.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
osta_udf.h Remove struct typedefs from fs/udf/ecma_167.h et al. 2009-04-02 12:29:47 +02:00
partition.c udf: remove redundant buffer_head.h includes 2015-03-14 07:54:02 +01:00
super.c udf: remove redundant buffer_head.h includes 2015-03-14 07:54:02 +01:00
symlink.c udf: remove redundant buffer_head.h includes 2015-03-14 07:54:02 +01:00
truncate.c udf: remove redundant buffer_head.h includes 2015-03-14 07:54:02 +01:00
udf_i.h udf: add extent cache support in case of file reading 2013-01-22 10:48:31 +01:00
udf_sb.h udf: Fortify LVID loading 2013-09-24 11:23:33 +02:00
udfdecl.h udf: Check path length when reading symlink 2014-12-19 14:12:08 +01:00
udfend.h Remove struct typedefs from fs/udf/ecma_167.h et al. 2009-04-02 12:29:47 +02:00
udftime.c udf: remove redundant sys_tz declaration 2014-09-29 13:45:12 +02:00
unicode.c udf: Check output buffer length when converting name to CS0 2016-02-01 14:54:15 -05:00