Debian Bug report logs - #932437
LUKS formatting of a 16 MB (sic!) device is possible, open not

version graph

Package: cryptsetup; Maintainer for cryptsetup is Debian Cryptsetup Team <pkg-cryptsetup-devel@alioth-lists.debian.net>; Source for cryptsetup is src:cryptsetup (PTS, buildd, popcon).

Reported by: Marc Haber <mh+debian-packages@zugschlus.de>

Date: Fri, 19 Jul 2019 10:45:01 UTC

Severity: normal

Tags: upstream

Found in version cryptsetup/2:2.1.0-5

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Cryptsetup Team <pkg-cryptsetup-devel@alioth-lists.debian.net>:
Bug#932437; Package cryptsetup. (Fri, 19 Jul 2019 10:45:04 GMT) (full text, mbox, link).


Acknowledgement sent to Marc Haber <mh+debian-packages@zugschlus.de>:
New Bug report received and forwarded. Copy sent to Debian Cryptsetup Team <pkg-cryptsetup-devel@alioth-lists.debian.net>. (Fri, 19 Jul 2019 10:45:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Marc Haber <mh+debian-packages@zugschlus.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: LUKS formatting of a 16 MB (sic!) device is possible, open not
Date: Fri, 19 Jul 2019 12:40:48 +0200
Package: cryptsetup
Version: 2:2.1.0-5
Severity: normal

Hi,

I would like to luksFormat a really tiny device (which will only hold a
single file) with LUKS or LUKS2. I have been doing this multiple times
in the past, and was surprised that it doesn't work any more with
current cryptsetup.

I already had to go from 4 MB to 16 MB for the format to succeed, but
the 16 MB device cannot be luksOpened ("Requested offset is beyond real
size of device /dev/sdf2."). This applies to both LUKS and LUKS2.

With a 32 MB device, I could luks2Format _and_ luks2Open _and_ even USE
device ;-)  I didn't bother to try plain LUKS with that size then.

cryptsetup should be more clear about minimum space requirement, and it
should use them consistently. Having a minimum size is ok, if I know of
it, and being able to format but not open a device because it's too
small is a bug.

Greetings
Marc



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Cryptsetup Team <pkg-cryptsetup-devel@alioth-lists.debian.net>:
Bug#932437; Package cryptsetup. (Fri, 19 Jul 2019 11:21:08 GMT) (full text, mbox, link).


Acknowledgement sent to Milan Broz <gmazyland@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Cryptsetup Team <pkg-cryptsetup-devel@alioth-lists.debian.net>. (Fri, 19 Jul 2019 11:21:08 GMT) (full text, mbox, link).


Message #10 received at 932437@bugs.debian.org (full text, mbox, reply):

From: Milan Broz <gmazyland@gmail.com>
To: 932437@bugs.debian.org
Subject: Re: Bug#932437: LUKS formatting of a 16 MB (sic!) device is possible, open not
Date: Fri, 19 Jul 2019 13:18:45 +0200
On 19/07/2019 12:40, Marc Haber wrote:
> I would like to luksFormat a really tiny device (which will only hold a
> single file) with LUKS or LUKS2. I have been doing this multiple times
> in the past, and was surprised that it doesn't work any more with
> current cryptsetup.

Default header size is much bigger because it reserves space for more
keyslots and optionally online reencryption. But it can be changed.

You can now create even smaller device with LUKS2, if you are
ok with a very small metadata size and only one keyslot (size of keyslot depends on
a key size, example is for XTS 512bit key).

I am able to create just 1MB LUKS header this way:

  cryptsetup luksFormat --type luks2 --luks2-metadata-size=16k --luks2-keyslots-size=256k img

or even smaller (here <300 kB), if you ignore default 1MB alignment

  cryptsetup luksFormat --type luks2 --luks2-metadata-size=16k --luks2-keyslots-size=256k --align-payload=1 img

> cryptsetup should be more clear about minimum space requirement, and it
> should use them consistently. Having a minimum size is ok, if I know of
> it, and being able to format but not open a device because it's too
> small is a bug.

For detached header you must be able to format header only (no data area).

But for the normal device, it is a bug, it should not format device and then complain
that it is too small :)

Also I think we should print default header size in --help output...

Anyway, this is upstream bug, so if you want to fill an issue for us, tracker
is here https://gitlab.com/cryptsetup/cryptsetup/issues

Thanks,
Milan



Added tag(s) upstream. Request was from Guilhem Moulin <guilhem@debian.org> to control@bugs.debian.org. (Fri, 05 Aug 2022 13:03:03 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 26 09:12:11 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.