]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
udf: Fix leak of UTF-16 surrogates into encoded strings
authorJan Kara <jack@suse.cz>
Thu, 12 Apr 2018 15:22:23 +0000 (17:22 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:49:45 +0000 (11:49 -0400)
commit51be941afce6d189d8eeee67e520dfcb87ad063e
tree461ff6397ec5f3f43c9530821daaf2d9c916c4c4
parente673e2add6153e3a416979d37f9af5768da4024f
udf: Fix leak of UTF-16 surrogates into encoded strings

BugLink: http://bugs.launchpad.net/bugs/1773233
commit 44f06ba8297c7e9dfd0e49b40cbe119113cca094 upstream.

OSTA UDF specification does not mention whether the CS0 charset in case
of two bytes per character encoding should be treated in UTF-16 or
UCS-2. The sample code in the standard does not treat UTF-16 surrogates
in any special way but on systems such as Windows which work in UTF-16
internally, filenames would be treated as being in UTF-16 effectively.
In Linux it is more difficult to handle characters outside of Base
Multilingual plane (beyond 0xffff) as NLS framework works with 2-byte
characters only. Just make sure we don't leak UTF-16 surrogates into the
resulting string when loading names from the filesystem for now.

CC: stable@vger.kernel.org # >= v4.6
Reported-by: Mingye Wang <arthur200126@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/udf/unicode.c