public inbox for dm-crypt@saout.de
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Jeremiah Moree <jtmoree@gmail.com>, dmcrypt <dm-crypt@saout.de>
Subject: [dm-crypt] Re: --disable-locks
Date: Fri, 24 Sep 2021 19:33:28 +0200	[thread overview]
Message-ID: <18f4e75c-6ed1-8c03-6d41-b05b20a0661a@gmail.com> (raw)
In-Reply-To: <CAAz2dUiPZmdJ2at2MYOfpjL=Lkabp3eBUBtDB_KFNfpD9KCrRQ@mail.gmail.com>

On 23/09/2021 15:01, Jeremiah Moree wrote:
> While searching through the source code I came upon docs/LUKS-locking.txt.  
> 
> From previous discussions on this list I understood the locking to be only for protection against concurrent user access.  This is how I wrote the FAQ entry that is now in the docs.

It protects LUKS2 metadata (serializes access to metadata update so concurrent processes cannot see partially updated metadata).

That said, in some situations activation of data device can rely on reliable metadata update.
For example, during reencryption, LUKS2 metadata is continuously updated when moving reencrypted area.

If you disable locking here, it will (almost for sure) corrupt the data (not only metadata).

> From this new-to-me doc it seems that locking is to also prevent header corruption.  I am surprised no one pointed this out in discussions so there is a chance I may be misunderstanding.

Interesting, I thought that we are primarily talking about metadata :)
 
> Specifically, this was in a discussion about --disable-locks.  Am I correct in stating:
> 
> Using --disable-locks I risk
> * concurrent user access problems
> *  header corruption

See above.

For the simple situation we do not need locks to activate device and prevent concurrent accerss
(kernel dm-crypt/device-mapper has internal locking that allows only one device activation in-kernel).

But LUKS2 device can be more complex stacks of devices (a reencryption in-progress is a nice example)
where the LUKS2 locking plays its role.

Milan
_______________________________________________
dm-crypt mailing list -- dm-crypt@saout.de
To unsubscribe send an email to dm-crypt-leave@saout.de

      parent reply	other threads:[~2021-09-24 17:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 13:01 [dm-crypt] --disable-locks Jeremiah Moree
2021-09-24  9:11 ` [dm-crypt] --disable-locks Arno Wagner
2021-09-24 17:33 ` Milan Broz [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=18f4e75c-6ed1-8c03-6d41-b05b20a0661a@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=jtmoree@gmail.com \
    /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