Commit Graph

37 Commits (db51a6426c58924acf6f741376383cb3ad0ba2d7)

Author SHA1 Message Date
Daniel Golle f3b9fc0d7a cryptsetup: update to version 2.7.4
Cryptsetup 2.7.4 Release Notes
==============================
Stable bug-fix release.

All users of cryptsetup 2.7 should upgrade to this version.

Changes since version 2.7.3
~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Detect device busy failure for device-mapper table-referenced devices.

  Some device-mapper ioctl failures can disappear in libdevmapper,
  causing the libcryptsetup wrapper to return an invalid error (EINVAL)
  instead of EEXIST or EBUSY. One such case is when there is a device
  creation race, and the device-mapper device name is created, but
  the following mapping table load fails. This can happen because some
  block devices used in table mapping have already been claimed by
  another process (the kernel needs exclusive access).

  The kernel ioctl properly returns EBUSY; this errno is lost in
  libdevmapper (dm_task_get_errno returns 0). It should be fixed by
  libdevmapper in the future.

  Such behavior was seen in the systemd way of handling dm-verity
  devices. With these changes, the code should react for EEXIST and
  EBUSY, as another process has already activated the device.

  Code calling libcryptsetup also must not check the underlying device
  with an exclusive open flag (O_EXCL). Otherwise, it could cause a race
  in the kernel device-mapper, resulting in no process succeeding device
  activation (see also CRYPT_ACTIVATE_SHARED flag below).

* Fix shared activation for dm-verity devices.

  The CRYPT_ACTIVATE_SHARED flag was silently ignored when activating
  dm-verity devices. Dm-verity shared activation is generally safe
  since all verity devices are read-only.

  The shared flag is a way to skip the exclusive access check for the
  device, allowing it to create multiple mappings with the same device or
  properly handle a racy concurrent activation of devices with the same
  name from different processes.

* Add --shared option for veritysetup open action.

  The option allows the data device to be used in multiple device-mapper
  table mappings (skip exclusive access check) or to allow concurrent
  dm-verity device activation of the same device (only one process
  succeeds in this case; the other will return EEXIST or EBUSY).

* Do not use exclusive flag for the allocated backing loop files.

  Using this flag is an undefined operation for opening an existing file.
  The flag should be used only for allocated loop (block) devices.

* Fixes for problems found by static analyzers and Valgrind.

  These include fixes for non-default libgcrypt, NSS, and Nettle
  cryptographic backends, buffer operations to avoid partial read/write,
  and several other workarounds for mostly false positive warnings.

* Fixes to tests and CI scripts.

Cryptsetup 2.7.3 Release Notes
==============================
Stable bug-fix release with security fixes.

All users of cryptsetup 2.7 must upgrade to this version.

Changes since version 2.7.2
~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Do not allow formatting LUKS2 with Opal SED (hardware encryption)
  if the reported logical sector size for the block device and Opal
  encryption logical block differs.

  Such a configuration can lead to a partially encrypted Opal locking
  range or data destruction following the expected locking range.

  Some NVMe drives support multiple LBAF profiles (typically supporting
  512-byte and 4096-byte sector size). Some broken Opal NVMe firmware can
  report bogus encryption size that disagrees with real used sector size.
  This usually happens after low-level NVMe reformatting (LBAF profile
  change with nvme utility) to different sector size.
  Moreover, some firmware versions do not properly reset this even after
  explicit PSID revert.

  Cryptsetup calculates the Opal locking range using the reported block
  size in Opal geometry ioctl.  Unfortunately, the broken firmware drive
  internally uses the logical block size of the block device, which can
  differ. This can lead to two possible situations:

  - Opal reports a smaller block size (512-byte) while the drive uses
  a 4096-byte sector. The configured locking range is then much larger,
  destroying data following the expected locking range setting.

  - Opal reports a larger block size (4096-byte) while the drive uses
  a 512-byte sector. The configured locking range is then much smaller,
  leaving the remaining space in the locking range unencrypted (violating
  the confidentiality of data).

  Cryptsetup now detects this discrepancy and disallows LUKS2 format with
  Opal hardware encryption in such a case.

  For already formatted devices, you will see this warning:
    "Bogus OPAL logical block size differs from device block size."

  If you also used software encryption (dm-crypt over Opal), data will
  still be fully encrypted with software dm-crypt.
  With hw-only encryption,  your configuration is probably already broken
  (insecure or accessing data beyond the assigned area).

  Note that this is caused by bad firmware (seen with multiple vendors),
  and the problem was reported, at least for drives we have access to.

* Fixes to wiping LUKS2 headers after Opal locking area erase.

  As the hardware locking range is destroyed (cryptsetup erase command),
  the LUKS2 header is no longer usable and was partially wiped.
  Now the code fully wipes also the secondary header, as the previous
  code wiped only the primary LUKS area.

  Note that this is an exception, as the normal erase command wipes only
  the keyslots, keeping the LUKS2 header in place.  With Opal encryption,
  the data segment is no longer valid, so the whole LUKS2 header is no
  longer usable.

* Mention the need for possible PSID revert before Opal format for some
  drives (man page).

* Fix Bitlocker-compatible code to ignore newly seen metadata entries.

  Recent Windows OS versions started to include new (undocumented)
  metadata entries in Bitlocker. These entries are now quietly ignored,
  allowing Bitlocker images to open with cryptsetup again.

* Fix interactive query retry if LUKS2 unbound keyslot is present.

  If an unbound keyslot is present, the password query retry count is
  now properly applied.

* Detect unsupported zoned devices for LUKS header devices.

  Zoned devices cannot be written with direct-io and used for LUKS header
  logic in general. Code now rejects placing the LUKS header on a zoned
  device, while you can still create a detached header and use a zoned
  device for encrypted data.

* Allow "capi" cipher format for benchmark command and fix parsing
  of plain IV in "capi" format.

  Some ciphers can be specified only in Linux kernel crypto notation
  (in short, "capi"). Code now allows this format also for benchmark,
  for example, "benchmark -c capi:xts\(aes\)-plain64"
  (that is equivalent to -c aes-xts-plain64).

* Add support for HCTR2 encryption mode.

  The HCTR2 encryption mode was added to the Linux kernel for fscrypt,
  but as it is a length-preserving mode (with sector tweak), it can be
  easily used for disk encryption, too.
  The mode has the same property as wide modes (any change is propagated
  to the whole sector instead of only one block as in XTS mode).

  As it needs a larger initialization vector (32 bytes), we need to add
  an exception in the userspace format code.
  You can now use --cipher aes-hctr2-plain64 for the format operation.

* Source code now uses SPDX license identifiers instead of full
  license preambles.

* Fix missing includes for cryptographic backend that could cause
  compilation errors for some systems.

* Fix tests to work correctly in FIPS mode with recent OpenSSL 3.2.

* Fix various (mostly false positive) issues detected by Coverity.

Cryptsetup 2.7.2 Release Notes
==============================
Stable bug-fix release.

All users of cryptsetup 2.7 should upgrade to this version.

Changes since version 2.7.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Fix activation of OPAL-only encrypted LUKS device with tokens.
  The issue was caused by an invalid volume key check (assert)
  that is impossible without software encryption.

* Fix formatting of OPAL devices with 4096-byte sector size.

* Fix incorrect OPAL locking range alignment calculation if used
  over an unaligned device partition.

* Add --hw-opal-factory-reset option description to the manual page.

* Do not check the passphrase quality for OPAL Admin PIN,
  as this passphrase already exists.

* Update license for FAQ document to CC BY-SA 4.0.

NOTE: Please note that with OPAL-only (--hw-opal-only) encryption,
the configured OPAL administrator PIN (passphrase) allows unlocking
all configured locking ranges without LUKS keyslot decryption
(without knowledge of LUKS passphrase).
Because of many observed problems with compatibility, cryptsetup
currently DOES NOT use OPAL single-user mode, which would allow such
decoupling of OPAL admin PIN access.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-08-02 01:38:45 +01:00
Daniel Golle 54a2534cb2 cryptsetup: update to version 2.7.1
The most notable change is the introduction of (optional) support for
hardware OPAL disk encryption. However, as this requires Linux 6.4 or
later, support for OPAL is implicitely disabled until targets used for
the package build have been updated to Linux 6.6.

See release notes for 2.7.0 and 2.7.1 for more details:

https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.7/v2.7.0-ReleaseNotes
https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.7/v2.7.1-ReleaseNotes

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-04-04 04:00:33 +01:00
Fabrice Fontaine cf0d28bf8c utils/cryptsetup: assign PKG_CPE_ID
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3🅰️cryptsetup_project:cryptsetup

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2024-01-25 21:26:56 +00:00
Daniel Golle 5c21b26a93 cryptsetup: update to version 2.6.1
Cryptsetup 2.6.1 Release Notes
==============================
Stable bug-fix release with minor extensions.

All users of cryptsetup 2.6.0 should upgrade to this version.

Changes since version 2.6.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~

* bitlk: Fixes for BitLocker-compatible on-disk metadata parser
  (found by new cryptsetup OSS-Fuzz fuzzers).
  - Fix a possible memory leak if the metadata contains more than
    one description field.
  - Harden parsing of metadata entries for key and description entries.
  - Fix broken metadata parsing that can cause a crash or out of memory.

* Fix possible iteration overflow in OpenSSL2 PBKDF2 crypto backend.
  OpenSSL2 uses a signed integer for PBKDF2 iteration count.
  As cryptsetup uses an unsigned value, this can lead to overflow and
  a decrease in the actual iteration count.
  This situation can happen only if the user specifies
  --pbkdf-force-iterations option.
  OpenSSL3 (and other supported crypto backends) are not affected.

* Fix compilation for new ISO C standards (gcc with -std=c11 and higher).

* fvault2: Fix compilation with very old uuid.h.

* verity: Fix possible hash offset setting overflow.

* bitlk: Fix use of startup BEK key on big-endian platforms.

* Fix compilation with latest musl library.
  Recent musl no longer implements lseek64() in some configurations.
  Use lseek() as 64-bit offset is mandatory for cryptsetup.

* Do not initiate encryption (reencryption command) when the header and
  data devices are the same.
  If data device reduction is not requsted, this leads to data corruption
  since LUKS metadata was written over the data device.

* Fix possible memory leak if crypt_load() fails.

* Always use passphrases with a minimal 8 chars length for benchmarking.
  Some enterprise distributions decided to set an unconditional check
  for PBKDF2 password length when running in FIPS mode.
  This questionable change led to unexpected failures during LUKS format
  and keyslot operations, where short passwords were used for
  benchmarking PBKDF2 speed.
  PBKDF2 benchmark calculations should not be affected by this change.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-08-05 12:16:08 +01:00
Daniel Golle d4d58fca4b
cryptsetup: fix compilation with musl 1.2.4
Similar to mdadm also cryptsetup now requires _LARGEFILE64_SOURCE.
Add -D_LARGEFILE64_SOURCE to TARGET_CFLAGS to fix compilation.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-05-18 03:18:27 +01:00
Daniel Golle cf26d633c7 cryptsetup: update to version 2.6.0
Update to new major release of cryptsetup. For details, please see
the release notes[1].

[1]: https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.6/v2.6.0-ReleaseNotes

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-12-20 01:41:42 +00:00
Daniel Golle 80439f802c
cryptsetup: update to version 2.5.0
Update to new major release of cryptsetup. For details, please see
the release notes[1].

[1]: https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.5/v2.5.0-ReleaseNotes
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-09-07 22:56:15 +01:00
Daniel Golle ad0ac5198d cryptsetup: fix library paths by calling autoreconf
Use PKG_FIXUP:=autoreconf when building cryptsetup to prevent
accidental linkage against host libraries.

Fixes: #19011
Reported-by: @dreirund
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-07-23 09:40:04 +01:00
Josef Schlehofer a2427edf76 cryptsetup: update to version 2.4.3
Fixes: CVE-2021-4122

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-01-18 18:43:56 +00:00
Daniel Golle 97dd009f58
cryptsetup: update to version 2.4.1
Package new experimental SSH token authenticator plugin as new package
'cryptsetup-ssh'.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-10-09 17:03:15 +01:00
Javier Marcet 2bff0b47aa cryptsetup: update to version 2.3.6
Signed-off-by: Javier Marcet <javier@marcet.info>
2021-07-24 00:04:40 +01:00
Daniel Golle c644917ca7
cryptsetup: update to version 2.3.5
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-03-25 23:31:00 +00:00
Rosen Penev 87a4eeb8de
cryptsetup: fix compilation with full NLS
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-09-28 23:11:57 -07:00
Daniel Golle 5de2a92542
cryptsetup: update to version 2.3.4
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-09-27 22:26:04 +01:00
Rosen Penev a989f2a2e1
cryptsetup: update to 2.3.3
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-06 21:09:27 -07:00
Rosen Penev e4d1fb27c6
cryptsetup: add NLS support
Needed for uClibc-ng.

Added InstallDev section. Because why not.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-14 16:18:41 -07:00
Rosen Penev 9758497e74
cryptsetup: update to 2.3.0
Use PKG_INSTALL for consistency between packages.

Add PKG_BUILD_PARALLEL for faster compilation.

Fix wrong locking path. First discovered here:
https://forum.openwrt.org/t/cannot-setup-dm-crypt/56836

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-04 19:30:52 -08:00
Daniel Golle ea0b3370e5 cryptsetup: update to version 2.2.2
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-01-07 01:27:16 +02:00
Jeffery To 53e1692ae9 treewide: Use default PKG_BUILD_DIR when possible
This removes lines that set PKG_BUILD_DIR when the set value is no
different from the default value.

Specifically, the line is removed if the assigned value is:

* $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

  The default PKG_BUILD_DIR was updated[1] to incorporate BUILD_VARIANT
  if it is set, so now this is identical to the default value.

* $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)

  if PKG_SOURCE_SUBDIR is set to $(PKG_NAME)-$(PKG_VERSION), making it
  the same as the previous case

* $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

  This is the same as the default PKG_BUILD_DIR when there is no
  BUILD_VARIANT.

* $(BUILD_DIR)/[name]-$(PKG_VERSION)

  where [name] is a string that is identical to PKG_NAME

[1]: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e545fac8d968864a965edb9e50c6f90940b0a6c9

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-10-13 02:01:34 +08:00
Sven Eckelmann bbb1ea7345 treewide: Change .*GPL.*+ licenses to SPDX compatible identifier
The CONTRIBUTING.md requests an (or multiple) SPDX identifier for GPL
licenses. But a lot of packages did use a different, non-SPDX style with a
"+" at the end instead of "-or-later".

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-09-10 07:45:15 +02:00
Daniel Golle 4f9d340677 cryptsetup: update to version 2.1.0
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-02 20:54:36 +01:00
Rosen Penev 4815585a3b cryptsetup: Remove OpenSSL variant
OpenSSL is only used for hashing while being a huge dependency (689.4KB
for mips_24kc.

Cryptsetup also supports and recommends argon2 for hashing, which is not
provided by OpenSSL.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-01-31 20:10:08 -08:00
Rosen Penev 685ca41089 cryptsetup: Replace libgcrypt with AFALG
Add several configure arguments to speed up build time.

Switch from using libgcrypt to using the kernel directly.

This has a number of benefits including smaller size and faster speed. It
also allows selection of desired crypto primatives instead of having all
of them.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-01-31 20:10:08 -08:00
Daniel Golle 1db9c7abb9 cryptsetup: update to version 2.0.6
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-01-29 09:48:55 +01:00
Rosen Penev dca56574e1
cryptsetup: Update to 2.0.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-10-30 17:44:47 -07:00
Rosen Penev dac07561bf
cryptsetup: Update to 2.0.4
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-08-07 15:31:30 -07:00
Rosen Penev bb351c9398 cryptsetup: Update to 2.0.3
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-06-14 20:54:40 -07:00
Daniel Golle 794e917b1a cryptsetup: update to version 1.7.5
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-06-05 18:22:04 +02:00
Alberto Bursi bb103260af cryptsetup: move to Encryption submenu
Part of a wider housekeeping effort on the packages repository.

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
2016-10-23 23:29:33 +02:00
Daniel Golle a91da16c2d cryptsetup: update to version 1.7.2
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2016-06-14 01:22:49 +02:00
Daniel Golle 6c7c823243 cryptsetup: fix MD5SUM forgotten during update
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2016-03-09 02:46:12 +01:00
Daniel Golle 0588c6745c cryptsetup: update to version 1.7.1
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2016-03-09 02:44:54 +01:00
Daniel Golle 3aeb3d4960 cryptsetup: update to 1.7.0
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-12-03 01:25:11 +01:00
Daniel Golle ee912a3869 cryptsetup: bump version
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-04-02 04:16:54 +02:00
Daniel Golle 52b5924f18 cryptsetup: bump copyright header
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2014-12-05 16:47:49 +01:00
Daniel Golle a7e91318ce cryptsetup: add PKG_LICENSE information
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2014-12-05 16:46:30 +01:00
Daniel Golle fc004f77e4 import cryptsetup from oldpackages
and bump version to 1.6.6 and switch to kernel.org mirror

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2014-12-05 15:44:02 +01:00