mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Cc: Jan Kara <jack@suse.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] udf: Fix conversion of 'dstring' fields to UTF8
Date: Mon, 25 Apr 2016 15:44:46 +0200	[thread overview]
Message-ID: <20160425134446.GA6523@quack2.suse.cz> (raw)
In-Reply-To: <1461583178-10341-1-git-send-email-andrew_gabbasov@mentor.com>

On Mon 25-04-16 06:19:38, Andrew Gabbasov wrote:
> Commit 9293fcfbc1812a22ad5ce1b542eb90c1bbe01be1
> ("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 484a10f49387e4386bf2708532e75bf78ffea2cb
> ("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.

Thanks. I've merged the patch to my tree.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2016-04-25 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 11:19 Andrew Gabbasov
2016-04-25 13:44 ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160425134446.GA6523@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=andrew_gabbasov@mentor.com \
    --cc=jack@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®