[pkg-cryptsetup-devel] Bug#612452: cryptsetup: filesystem check with blkid script is not reliable

Christoph Schindler hop at 30hopsmax.at
Tue Feb 8 14:40:16 UTC 2011


Package: cryptsetup
Version: 2:1.1.3-4
Severity: minor


With the upgrade to squeeze, the default cipher for crypt devices
changed, but cryptdisks_start still accepts the (wronly decrypted)
device as containing an ext3 filesystem.

This happens at least when using the current default cipher to decrypt
a device that was created with the previous default cipher.

This simulates what cryptdisks_start does:

	pvsvie0401:~# cryptsetup create backup_0 /dev/mapper/
	Enter passphrase: 
	pvsvie0401:~# blkid -o value -s TYPE -p /dev/mapper/backup_0 
	ext3

The created device checks out as having a valid ext3 filesystem, but it
will not mount.

	pvsvie0401:~# mount /dev/mapper/backup_0 /srv/backup_0/
	mount: wrong fs type, bad option, bad superblock on
	/dev/mapper/backup_0,
	       missing codepage or helper program, or other error
	       In some cases useful info is found in syslog - try
	       dmesg | tail  or so

If I configure the correct cipher in crypttab, everything works fine.
  
	pvsvie0401:~# cryptsetup remove /dev/mapper/backup_0 
	pvsvie0401:~# cryptsetup -c aes-plain create backup_0 /dev/mapper/pvsvie0401_0-cbackup_0 
	Enter passphrase: 
	pvsvie0401:~# blkid -o value -s TYPE -p /dev/mapper/backup_0 
	ext3
	pvsvie0401:~# mount /dev/mapper/backup_0 /srv/backup_0/
	pvsvie0401:~# reportbug --help

This is confusing, since it suggests that everything worked fine with
decrypting the device, and the error must lie somewhere else (mount, etc.)

hop


-- Package-specific info:
-- /proc/cmdline
BOOT_IMAGE=/vmlinuz-2.6.32-5-amd64 root=/dev/mapper/pvsvie0401_0-root ro quiet

-- /etc/crypttab
# <target name>	<source device>		<key file>	<options>
backup_0	/dev/pvsvie0401_0/cbackup_0	none	noauto,check=blkid
backup_1	/dev/pvsvie0401_1/cbackup_1	none	noauto,check=blkid

-- /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
LABEL=root	/               ext3    errors=remount-ro 0       1
# /dev/sda1       /boot           ext3    defaults        0       2
UUID=a02c9905-0405-4ad9-a26b-7ff0e2414b38       /boot           ext3    defaults        0       2
# /dev/sda2       none            swap    sw              0       0
UUID=f17b4560-175d-462e-b094-8c48c98f1623       none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0

LABEL=backup_0  /srv/backup_0	ext3	noauto,noatime,nodiratime	0 0
LABEL=backup_1  /srv/backup_1	ext3	noauto,noatime,nodiratime	0 0

-- lsmod
Module                  Size  Used by
sha256_generic          8692  2 
aes_x86_64              7340  3 
aes_generic            25714  1 aes_x86_64
cbc                     2539  2 
btrfs                 375670  0 
zlib_deflate           17746  1 btrfs
crc32c                  2560  1 
libcrc32c               1074  1 btrfs
ufs                    56474  0 
qnx4                    6194  0 
hfsplus                65270  0 
hfs                    37455  0 
minix                  21197  0 
ntfs                  162796  0 
vfat                    7884  0 
msdos                   6202  0 
fat                    40038  2 vfat,msdos
jfs                   140089  0 
xfs                   436941  0 
exportfs                3170  1 xfs
reiserfs              194156  0 
ext4                  289033  0 
jbd2                   67015  1 ext4
crc16                   1319  1 ext4
ext2                   52969  0 
loop                   11799  0 
dm_crypt               10664  2 
snd_hda_codec_realtek   235602  1 
snd_hda_intel          20019  0 
snd_hda_codec          54244  2 snd_hda_codec_realtek,snd_hda_intel
snd_hwdep               5380  1 snd_hda_codec
snd_pcm                60503  2 snd_hda_intel,snd_hda_codec
snd_timer              15582  1 snd_pcm
snd                    46446  6 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore               4598  1 snd
i915                  255262  0 
parport_pc             18855  0 
snd_page_alloc          6249  2 snd_hda_intel,snd_pcm
parport                27954  1 parport_pc
evdev                   7352  3 
drm_kms_helper         20065  1 i915
i2c_i801                7830  0 
drm                   142359  2 i915,drm_kms_helper
i2c_algo_bit            4225  1 i915
pcspkr                  1699  0 
i2c_core               15712  5 i915,drm_kms_helper,i2c_i801,drm,i2c_algo_bit
video                  17445  1 i915
button                  4650  1 i915
output                  1692  1 video
processor              29935  0 
ext3                  106518  3 
jbd                    37085  1 ext3
mbcache                 5050  3 ext4,ext2,ext3
dm_mod                 53754  13 dm_crypt
sd_mod                 29889  6 
crc_t10dif              1276  1 sd_mod
usb_storage            39625  0 
ahci                   32374  4 
libata                133632  1 ahci
uhci_hcd               18521  0 
ehci_hcd               31151  0 
thermal                11674  0 
r8169                  29229  0 
mii                     3210  1 r8169
scsi_mod              122149  3 sd_mod,usb_storage,libata
usbcore               122034  4 usb_storage,uhci_hcd,ehci_hcd
nls_base                6377  7 hfsplus,hfs,ntfs,vfat,fat,jfs,usbcore
thermal_sys            11942  3 video,processor,thermal


-- System Information:
Debian Release: 6.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cryptsetup depends on:
ii  dmsetup                      2:1.02.48-5 The Linux Kernel Device Mapper use
ii  libc6                        2.11.2-10   Embedded GNU C Library: Shared lib
ii  libdevmapper1.02.1           2:1.02.48-5 The Linux Kernel Device Mapper use
ii  libpopt0                     1.16-1      lib for parsing cmdline parameters
ii  libuuid1                     2.17.2-9    Universally Unique ID library

cryptsetup recommends no packages.

Versions of packages cryptsetup suggests:
ii  busybox                       1:1.17.1-8 Tiny utilities for small and embed
pn  dosfstools                    <none>     (no description available)
ii  initramfs-tools [linux-initra 0.98.8     tools for generating an initramfs
ii  udev                          164-3      /dev/ and hotplug management daemo

-- Configuration Files:
/etc/bash_completion.d/cryptsetup changed [not included]

-- no debconf information





More information about the pkg-cryptsetup-devel mailing list