DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nico R." <n-roeser@gmx.net>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] Exhaustive key reading seems to silently stop on error
Date: Fri, 11 Dec 2009 11:57:14 +0100	[thread overview]
Message-ID: <4B22258A.4070009@gmx.net> (raw)
In-Reply-To: <20091211040619.GA6979@tansi.org>

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

Hi!

(De-TOFU-ized.)

> On Wed, Dec 09, 2009 at 11:25:53PM +0100, Nico R. wrote:
[…]
>> In lib/utils.c (line 450f. in cryptsetup-1.0.7; line 490f. in current
>> SVN revision, r132, equal to r152), we see the following code:
>>
>> if(read(fd, pass + i, 1) != 1 || (newline_stop && pass[i] == '\n'))
>>         break;
>>
>> If I interpret that snipped (and its surroundings) correctly, the code
>> will read until EOF *or* until an error occurs.
>>
>> If my interpretation is true, that code causes a problem:
[…]

Arno Wagner wrote:
> Hmm. This seems to indeed be a bug.
> 
> I gather there is no code later that distinguishes 
> EOF and error and deals with the second possibility?

As far as I can see, there is not. See
<URL:http://code.google.com/p/cryptsetup/source/browse/trunk/lib/utils.c?r=132#480>.
-- 
Nico


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2009-12-11 10:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 22:25 [dm-crypt] Exhaustive key reading seems to silently stop on error Nico R.
2009-12-11  4:06 ` Arno Wagner
2009-12-11 10:57   ` Nico R. [this message]
2009-12-11 11:59     ` Milan Broz

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=4B22258A.4070009@gmx.net \
    --to=n-roeser@gmx.net \
    --cc=dm-crypt@saout.de \
    /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