summaryrefslogtreecommitdiffstats
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authorAndrew Gabbasov <andrew_gabbasov@mentor.com>2015-12-24 17:25:33 +0100
committerJan Kara <jack@suse.cz>2016-01-04 15:57:49 +0100
commitbb00c898ad1ce40c4bb422a8207ae562e9aea7ae (patch)
treedca567eb137f212cab63c725599aafdd62e84129 /fs/udf/inode.c
parentudf: Prevent buffer overrun with multi-byte characters (diff)
downloadlinux-bb00c898ad1ce40c4bb422a8207ae562e9aea7ae.tar.xz
linux-bb00c898ad1ce40c4bb422a8207ae562e9aea7ae.zip
udf: Check output buffer length when converting name to CS0
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>
Diffstat (limited to 'fs/udf/inode.c')
0 files changed, 0 insertions, 0 deletions