DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Bächler" <thomas@archlinux.org>
To: dm-crypt@saout.de, Milan Broz <gmazyland@gmail.com>
Subject: [dm-crypt] libcryptsetup kernel feature detection fails on boot
Date: Wed, 23 Jul 2014 00:36:19 +0200	[thread overview]
Message-ID: <53CEE763.4030409@archlinux.org> (raw)

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

Since cryptsetup 1.6.5, libcryptsetup fails to detect the kernel's
features on boot. In particular, whenever the dm-crypt module is not
loaded before configuring a mapping with libcryptsetup, the
allow_discards option is not used.

# rmmod dm_crypt

# /usr/lib/systemd/systemd-cryptsetup attach test /dev/loop0 none
allow-discards,tries=0
Please enter passphrase for disk test! ****
Set cipher aes, mode xts-plain64, key size 256 bits for device /dev/loop0.

# cryptsetup status test
/dev/mapper/test is active.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 256 bits
  device:  /dev/loop0
  loop:    /tmp/testfile
  offset:  4096 sectors
  size:    405504 sectors
  mode:    read/write

# /usr/lib/systemd/systemd-cryptsetup detach test

# /usr/lib/systemd/systemd-cryptsetup attach test /dev/loop0 none
allow-discards,tries=0
Please enter passphrase for disk test! ****
Set cipher aes, mode xts-plain64, key size 256 bits for device /dev/loop0.

# cryptsetup status test
/dev/mapper/test is active.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 256 bits
  device:  /dev/loop0
  loop:    /tmp/testfile
  offset:  4096 sectors
  size:    405504 sectors
  mode:    read/write
  flags:   discards

The culprit seems to be dm_check_versions() in lib/libdevmapper.c - the
version number returned here differs when dm_crypt is not loaded.


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

             reply	other threads:[~2014-07-22 22:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 22:36 Thomas Bächler [this message]
2014-07-23  7:45 ` [dm-crypt] libcryptsetup kernel feature detection fails on boot Milan Broz
2014-07-24 20:20   ` 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=53CEE763.4030409@archlinux.org \
    --to=thomas@archlinux.org \
    --cc=dm-crypt@saout.de \
    --cc=gmazyland@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