tmp_suning_uos_patched/fs/udf
Andrew Gabbasov c26f6c6157 udf: Fix conversion of 'dstring' fields to UTF8
Commit 9293fcfbc1
("udf: Remove struct ustr as non-needed intermediate storage"),
while getting rid of 'struct ustr', does not take any special care
of 'dstring' fields and effectively use fixed field length instead
of actual string length, encoded in the last byte of the field.

Also, commit 484a10f493
("udf: Merge linux specific translation into CS0 conversion function")
introduced checking of the length of the string being converted,
requiring proper alignment to number of bytes constituing each
character.

The UDF volume identifier is represented as a 32-bytes 'dstring',
and needs to be converted from CS0 to UTF8, while mounting UDF
filesystem. The changes in mentioned commits can in some cases
lead to incorrect handling of volume identifier:
- if the actual string in 'dstring' is of maximal length and
does not have zero bytes separating it from dstring encoded
length in last byte, that last byte may be included in conversion,
thus making incorrect resulting string;
- if the identifier is encoded with 2-bytes characters (compression
code is 16), the length of 31 bytes (32 bytes of field length minus
1 byte of compression code), taken as the string length, is reported
as an incorrect (unaligned) length, and the conversion fails, which
in its turn leads to volume mounting failure.

This patch introduces handling of 'dstring' encoded length field
in udf_CS0toUTF8 function, that is used in all and only cases
when 'dstring' fields are converted. Currently these cases are
processing of Volume Identifier and Volume Set Identifier fields.
The function is also renamed to udf_dstrCS0toUTF8 to distinctly
indicate that it handles 'dstring' input.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Jan Kara <jack@suse.cz>
2016-04-25 15:18:50 +02:00
..
balloc.c udf: Factor out code for creating indirect extent 2015-12-23 18:04:52 +01:00
dir.c udf: Use separate buffer for copying split names 2016-02-09 13:05:23 +01:00
directory.c
ecma_167.h
file.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
ialloc.c
inode.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
Kconfig
lowlevel.c
Makefile
misc.c
namei.c udf: Use separate buffer for copying split names 2016-02-09 13:05:23 +01:00
osta_udf.h
partition.c
super.c udf: Fix conversion of 'dstring' fields to UTF8 2016-04-25 15:18:50 +02:00
symlink.c don't put symlink bodies in pagecache into highmem 2015-12-08 22:41:36 -05:00
truncate.c
udf_i.h fs: cleanup slight list_entry abuse 2015-06-23 18:01:59 -04:00
udf_sb.h
udfdecl.h udf: Fix conversion of 'dstring' fields to UTF8 2016-04-25 15:18:50 +02:00
udfend.h
udftime.c
unicode.c udf: Fix conversion of 'dstring' fields to UTF8 2016-04-25 15:18:50 +02:00