Creating an encrypted volume type without a cipher accepted but will fail to create an encrypted volume

Bug #1926630 reported by Lee Yarwood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
In Progress
Medium
Eric Harney

Bug Description

There appears to be no validation done by c-api when creating an encrypted volume type that leads to volume creation failures later when used:

$ openstack volume type create --encryption-provider luks --encryption-key-size 256 --encryption-control-location front-end luks
$ openstack volume type show luks
+--------------------+--------------------------------------+
| Field | Value |
+--------------------+--------------------------------------+
| access_project_ids | None |
| description | None |
| id | 81de0e95-4128-4fd2-adbb-add832c6683c |
| is_public | True |
| name | luks |
| properties | |
| qos_specs_id | None |
+--------------------+--------------------------------------+
$ openstack volume create --size 1 --type luks luks

c-vol failure:

2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server [req-8224c046-d157-44f5-829b-e376ddf19743 2fcb35dd719f47b9bafd151dd122bbfb 3f2eb42c05bd4d0084648cb2f873a562 - default default] Exception during message handling: AttributeError: 'NoneType' object has no attribute 'split'
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 166, in _process_incoming
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 220, in dispatch
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 190, in _do_dispatch
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "<string>", line 2, in create_volume
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/cinder/objects/cleanable.py", line 207, in wrapper
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server result = f(*args, **kwargs)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 690, in create_volume
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server _run_flow()
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 682, in _run_flow
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server flow_engine.run()
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/engine.py", line 247, in run
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server for _state in self.run_iter(timeout=timeout):
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/engine.py", line 340, in run_iter
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server failure.Failure.reraise_if_any(er_failures)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/taskflow/types/failure.py", line 336, in reraise_if_any
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server failures[0].reraise()
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/taskflow/types/failure.py", line 343, in reraise
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server six.reraise(*self._exc_info)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server result = task.execute(**arguments)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/cinder/volume/flows/manager/create_volume.py", line 1028, in execute
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server model_update = self._create_raw_volume(volume, **volume_spec)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/cinder/volume/flows/manager/create_volume.py", line 995, in _create_raw_volume
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server ret = self.driver.create_volume(volume)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py", line 859, in create_volume
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server return self._create_encrypted_volume(volume, volume.obj_context)
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py", line 829, in _create_encrypted_volume
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server encryption['key_size'])
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/cinder/image/image_utils.py", line 744, in decode_cipher
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server cipher_alg, cipher_mode, ivgen_alg = cipher_spec.split('-')
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server AttributeError: 'NoneType' object has no attribute 'split'
2021-04-29 15:16:01.286 58 ERROR oslo_messaging.rpc.server

Eric Harney (eharney)
Changed in cinder:
assignee: nobody → Eric Harney (eharney)
Revision history for this message
Eric Harney (eharney) wrote :
Changed in cinder:
importance: Undecided → Medium
status: New → In Progress
tags: added: encryption volume
tags: added: cipher type
Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :
Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.