public inbox for dm-crypt@saout.de
 help / color / mirror / Atom feed
From: Robert Nichols <rnicholsNOSPAM@comcast.net>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] Why is it necessary to "wipe" an authenticated luks2 device when creating it?
Date: Thu, 26 Sep 2019 08:38:34 -0500	[thread overview]
Message-ID: <qmif0r$3ifq$1@blaine.gmane.org> (raw)
In-Reply-To: <83ff6ae8-0ac3-a2d3-a982-750862018d7c@gmail.com>


On 9/26/19 2:41 AM, Milan Broz wrote:
> On 25/09/2019 21:40, .. ink .. wrote:
>> I just added an ability to create an authenticated luks2 device in
>> zuluCrypt[1] and i am
>> wondering why these volumes need to be wiped when created. I made it work by
>> looking at how cryptsetup does it but i don't understand why because i
>> have so far
>> failed to find any documentation about it.
> 
> I think it is explained in the referenced paper, we should add a FAQ about it.
> 
> Initial wipe recalculates integrity tags - so you can read the device afterward.
> 
> If you skip initialization (wipe), integrity tags for all sectors is incorrect
> and read will return integrity failure (EILSEQ errno).
> 
> In theory, it is not a problem ("do not read what you did not write").
> 
> But it reality it cases many programs to fail because it can access device
> through page cache. If the *write* is not aligned to a page, page cache tries
> to first read content, then update content, and write it back to the device.
> 
> But as said above, all read fails because integrity tags are not initialized,
> thus even page-unaligned writes can fail.
> (I have seen this problem even in programs like mkfs, where it is apparent bug.)

So, LUKS2 is incompatible with LVM thin provisioning or other sparse storage
formats like QCOW2. Good to know.

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.

  parent reply	other threads:[~2019-09-26 13:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 19:40 [dm-crypt] Why is it necessary to "wipe" an authenticated luks2 device when creating it? .. ink ..
2019-09-26  7:41 ` Milan Broz
2019-09-26  9:36   ` Christoph Anton Mitterer
2019-09-26 13:38   ` Robert Nichols [this message]
2019-09-26 14:29     ` Ondrej Kozina
2019-09-26 21:27       ` Robert Nichols
2019-09-26 22:20         ` Arno Wagner
2019-09-27  8:52         ` Milan Broz
2019-09-26 14:23   ` Arno Wagner

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='qmif0r$3ifq$1@blaine.gmane.org' \
    --to=rnicholsnospam@comcast.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