Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
If we format a device with this command:
======
cryptsetup -c aes-cbc-essiv:sha256 -s 512 luksFormat /dev/sdb
======
It will fail with this error message:
======
device-mapper: reload ioctl failed: Invalid argument
Failed to setup dm-crypt key mapping for device /dev/sdb.
Check that kernel supports aes-cbc-essiv:sha256 cipher (check syslog for more info).
======
Actually, it just a because use specify key-size both in cipher-mode and key-size rather than kernel support issue.
Version-Release number of selected component (if applicable):
cryptsetup-luks-1.2.0-3.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Kick off
cryptsetup -c aes-cbc-essiv:sha256 -s 512 luksFormat /dev/sdb
2. Check the error message.
Actual results:
Fail with confusing error message.
Expected results:
Inform user that he is trying to specify keysize both in cipher-mode and key-size option.
Additional info:
This is all related to how kernel dmcrypt reports problems if it is not able to create tpm - there is no additional info.
I tried to add some hints in userspace when this happens, so we can add another one. (We cannot parse /proc/crypt in advance to check supported key sizes because modules are autoloaded per request - so the /proc.crypto could be empty before call.)
But if user is specifying cipher/mode/key size yourself, he should know what he is doing. (here is aparent that AES-512 doesn't exists. 512bits key makes sense only on AES-XTS or similar mode, where is is split internaly to two AES-256 keys.)
> Inform user that he is trying to specify keysize both in cipher-mode and
key-size option.
What do you mean by that? that command line is formally correct, just selected algorithm/mode combination does not support that key size.
E.g. try
cryptsetup -c aes-cbc-essiv:sha256 -s 128 luksFormat /dev/sdb
cryptsetup -c aes-cbc-essiv:sha256 -s 256 luksFormat /dev/sdb
cryptsetup -c blowfish-cbc-essiv:sha256 -s 448 luksFormat /dev/sdb
cryptsetup -c aes-xts-plain64 -s 512 luksFormat /dev/sdb
etc.
Thanks for the clarification. It's my misunderstanding about '-c aes-cbc-essiv:sha256 -s 128'. I was thinking "sha256" is the key size.
For the /proc/crypt thing, how about warning user if command failed with specified the key size, so that they will check the "max keysize" in /proc/crypt.
Comment 7RHEL Program Management
2012-07-10 08:23:25 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 8RHEL Program Management
2012-07-10 23:11:08 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development. This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
Comment 9RHEL Program Management
2012-10-16 16:09:36 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Comment 10RHEL Program Management
2013-02-08 12:16:32 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.
Description of problem: If we format a device with this command: ====== cryptsetup -c aes-cbc-essiv:sha256 -s 512 luksFormat /dev/sdb ====== It will fail with this error message: ====== device-mapper: reload ioctl failed: Invalid argument Failed to setup dm-crypt key mapping for device /dev/sdb. Check that kernel supports aes-cbc-essiv:sha256 cipher (check syslog for more info). ====== Actually, it just a because use specify key-size both in cipher-mode and key-size rather than kernel support issue. Version-Release number of selected component (if applicable): cryptsetup-luks-1.2.0-3.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. Kick off cryptsetup -c aes-cbc-essiv:sha256 -s 512 luksFormat /dev/sdb 2. Check the error message. Actual results: Fail with confusing error message. Expected results: Inform user that he is trying to specify keysize both in cipher-mode and key-size option. Additional info: