[Bug 1960916] [NEW] cryptswap overwrites existing LUKS partition

RedFantom 1960916 at bugs.launchpad.net
Tue Feb 15 12:17:47 UTC 2022


Public bug reported:

This bug is related to:
https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/474258

In spite of the implementation of cryptswap checking for existing
filesystems, I think I have encountered a bug. cryptswap still creates
the swap partition if the target partition does not contain a
filesystem, but a LUKS partition.

I have been able to reproduce this issue without meaning to. After
adding a drive my /dev/sdX assignments shifted, and I lost a partition
full of data. However, in spite of attempts to recreate the data
partition, the LUKS header kept being overwritten by random data.

That's when I saw this: https://imgur.com/Zl5sYbkl.png

cryptswap has been overwriting the partitions. The partitions contained
LUKS Encrypted ext4 filesystems created using gnome-disks.

I have a specific hardware device that I use for SWAP, so in a way it
was my own mistake for not updating /etc/crypttab when connecting the
new drive, but in my opinion cryptswap should not destroy a LUKS
partition to a point where even with header it is difficult to recover
any data simply because a drive has been changed. As far as I have been
able to find, cryptswap with UUID is still not possible after all.

** Affects: cryptsetup (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: dataloss

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to cryptsetup in Ubuntu.
https://bugs.launchpad.net/bugs/1960916

Title:
  cryptswap overwrites existing LUKS partition

Status in cryptsetup package in Ubuntu:
  New

Bug description:
  This bug is related to:
  https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/474258

  In spite of the implementation of cryptswap checking for existing
  filesystems, I think I have encountered a bug. cryptswap still creates
  the swap partition if the target partition does not contain a
  filesystem, but a LUKS partition.

  I have been able to reproduce this issue without meaning to. After
  adding a drive my /dev/sdX assignments shifted, and I lost a partition
  full of data. However, in spite of attempts to recreate the data
  partition, the LUKS header kept being overwritten by random data.

  That's when I saw this: https://imgur.com/Zl5sYbkl.png

  cryptswap has been overwriting the partitions. The partitions
  contained LUKS Encrypted ext4 filesystems created using gnome-disks.

  I have a specific hardware device that I use for SWAP, so in a way it
  was my own mistake for not updating /etc/crypttab when connecting the
  new drive, but in my opinion cryptswap should not destroy a LUKS
  partition to a point where even with header it is difficult to recover
  any data simply because a drive has been changed. As far as I have
  been able to find, cryptswap with UUID is still not possible after
  all.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/1960916/+subscriptions




More information about the foundations-bugs mailing list