Yuri Chornoivan
4143d9871e
Fix minor typos
2019-06-28 12:02:39 +00:00
Ondrej Kozina
d4682b3b38
Cleanup translated messages id.
...
- minimize count of almost identical message ids
- unify style for some messages
- remove some useless messages
2019-06-27 10:23:42 +02:00
Ondrej Kozina
2f4a50064f
Add direction hint in reencryption hotzone device name.
2019-06-27 10:23:36 +02:00
Ondrej Kozina
292a5f50b2
Allow offline reencryption on files without root privileges.
...
If userspace block ciphers are not available try kcapi first.
2019-06-27 10:19:23 +02:00
Ondrej Kozina
c25ce7c585
Allow disabling of reencryption locks via crypt_metadata_locking()
2019-06-27 10:19:18 +02:00
Ondrej Kozina
b22c9a86a9
Add internal crypt_zalloc routine (calloc wrapper).
2019-06-27 10:19:14 +02:00
Ondrej Kozina
614f671b92
Introduce SUBDEV internal device type.
...
LUKS2 and other device types allow stacking of dm devices
underneath public top level device.
The new type identifies clearly those private devices in respective
device stack so that they can be easily removed while removing
top level public device.
Switch LUKS2 reencryption device stack to use SUBDEV type immmediately
for hotzone and overlay devices. Other devices will follow in later
releases.
2019-06-27 10:19:01 +02:00
Ondrej Kozina
af62dbf3d3
Add internal limit for count of dm dependencies.
...
32 should be enough (+1 for terminating NULL byte)
2019-06-27 10:18:58 +02:00
Ondrej Kozina
249e6af3a6
Add LUKS2 uuid component in underlying dm-integrity device.
2019-06-27 10:18:56 +02:00
Ondrej Kozina
aba95b00aa
Activate underlying dm-integrity privately for LUKS2 w/ auth. encryption.
2019-06-27 10:18:50 +02:00
Ondrej Kozina
4e19719bdd
Check hotzone size and device size alignment earlier.
...
It failed later but it was difficult to understand what went wrong.
2019-06-27 10:18:44 +02:00
Ondrej Kozina
3cabf608ca
Unify reencryption context load error messages.
2019-06-27 10:18:37 +02:00
Milan Broz
2e841622f8
Print proper error message if LUKS2 slot encryption fail.
2019-06-26 17:30:30 +02:00
Guilhem Moulin
70c4ce199d
Fix minor spelling errors in manpage and messages.
...
Reported by lintian(1) - Static analysis tool for Debian packages:
accidentaly -> accidentally
trigerring -> triggering
alocate -> allocate
alignemnt -> alignment
initalize -> initialize
2019-06-18 09:42:28 +02:00
Ondrej Kozina
272505b99d
If no hash is specified in pbkdf use default value for keyslot AF.
2019-06-13 17:04:21 +02:00
Ondrej Kozina
60a769955b
Rename hash data parameter in reencrypt keyslot dump.
2019-06-12 12:36:51 +02:00
Ondrej Kozina
34bec53474
Drop excessive nested locking in LUKS2 keyslot store path.
...
Since commit 80a435f it's not needed to call device_write_lock
in function luks2_encrypt_to_storage. It's handled correctly on
upper layer.
2019-06-12 12:36:51 +02:00
Ondrej Kozina
c77ae65a0d
Wipe both keyslot data and metadata holding single write lock.
2019-06-12 12:36:51 +02:00
Ondrej Kozina
1ed0430b82
Move LUKS2 write lock upper when storing reencryption keyslot.
2019-06-12 12:36:51 +02:00
Ondrej Kozina
44aabc3ae4
Drop reload of metadata in reencryption initialization.
2019-06-12 12:36:50 +02:00
Ondrej Kozina
bbdf9b2745
Read and compare metadata sequence id after taking write lock.
2019-06-12 12:36:46 +02:00
Ondrej Kozina
96a87170f7
Return usage count from device locking functions.
2019-06-12 11:51:08 +02:00
Ondrej Kozina
9c3a020ecf
Remove useless debug message from keyslot dump.
2019-05-27 16:23:56 +02:00
Ondrej Kozina
4c4cc55bb7
Wipe backup segment data after reencryption is finished.
2019-05-27 16:05:21 +02:00
Ondrej Kozina
f4c2e7e629
Implement LUKS2 reencrypt keyslot dump.
2019-05-27 15:27:23 +02:00
Ondrej Kozina
0c725a257d
Compare moved segment specific size against real device size only.
2019-05-24 17:29:56 +02:00
Ondrej Kozina
bd6af68bc5
Add support for explicit reencryption recovery in request.
2019-05-24 17:07:37 +02:00
Ondrej Kozina
13050f73c1
Properly finished reencryption after recovery.
2019-05-24 17:07:37 +02:00
Ondrej Kozina
5472fb0c56
Refactor reencryption recovery during activation.
2019-05-24 17:07:36 +02:00
Ondrej Kozina
60d26be325
Load volume key in keyring when activated by token.
...
LUKS2 should use keyring for dm-crypt volume keys by default
when possible. crypt_activate_by_token didn't load keys in
keyring by default. It was a bug.
2019-05-21 18:08:00 +02:00
Ondrej Kozina
013d0d3753
Rename internal reencrypt enum to REENC_PROTECTION_NONE.
2019-05-21 18:08:00 +02:00
Ondrej Kozina
31cd41bfe4
Add support for reencryption of initial device part.
...
It's useful to reencrypt only initial device part only.
For example with golden image reencryption it may be useful
to reencrypt only first X bytes of device because we know
the rest of device is empty.
2019-05-21 15:54:07 +02:00
Ondrej Kozina
af6c321395
Set default length for reencryption with resilience 'none' only.
2019-05-21 15:54:07 +02:00
Ondrej Kozina
1923928fdc
Drop duplicate error message from reencrypt load.
2019-05-21 15:54:07 +02:00
Ondrej Kozina
8c8a68d850
Add CRYPT_REENCRYPT_RESUME_ONLY flag.
2019-05-13 18:23:20 +02:00
Ondrej Kozina
2d0079905e
Adapt device_open_excl to reusing of fds.
2019-05-10 21:05:31 +02:00
Ondrej Kozina
83c227d53c
Sync device using internal write enabled descriptor.
2019-05-10 21:05:31 +02:00
Ondrej Kozina
ee57b865b0
Reuse device file desriptors.
2019-05-10 21:05:31 +02:00
Ondrej Kozina
8545e8496b
Fix memleak in reencryption with moved segment.
2019-05-07 17:17:34 +02:00
Milan Broz
237021ec15
Fix some warnings in static analysis.
2019-05-07 13:44:43 +02:00
Milan Broz
1f91fe7a2c
Use JSON-debug wrappers.
2019-05-03 14:02:43 +02:00
Ondrej Kozina
a7f80a2770
Add resilient LUKS2 reencryption library code.
2019-05-02 16:44:23 +02:00
Ondrej Kozina
345385376a
Add missing validation check for area type specification.
2019-04-29 16:10:57 +02:00
Milan Broz
dbe9db26fc
Never serialize memory-hard KDF for small amount of memory.
2019-04-29 16:10:57 +02:00
Ondrej Kozina
86b2736480
Drop unused type parameter from LUKS2_keyslot_find_empty()
2019-04-23 10:41:56 +02:00
Milan Broz
cfe2fb66ab
Fix some untranslated error messages.
2019-04-23 10:41:06 +02:00
Milan Broz
1b49ea4061
Add global serialization lock for memory hard PBKDF.
...
This is very ugly workaround for situation when multiple
devices are being activated in parallel (systemd crypttab)
and system instead of returning ENOMEM use OOM killer
to randomly kill processes.
This flag is intended to be used only in very specific situations.
2019-03-29 11:58:12 +01:00
Ondrej Kozina
80a435f00b
Write keyslot binary data and metadata holding single lock.
2019-03-25 11:37:32 +01:00
Ondrej Kozina
fdcd5806b1
Allow to change requirements flag in-memory only.
2019-03-25 11:37:32 +01:00
Ondrej Kozina
fea2e0be4f
Add algorithm for searching largest gap in keyslots area.
2019-03-13 14:56:31 +01:00