Switch to volume key keyring helpers.

And do not access volume key internals bearing
information whether the key payload was uploaded
in kernel keyring or not.
This commit is contained in:
Ondrej Kozina
2025-02-04 15:45:18 +01:00
committed by Milan Broz
parent 15c4a410fd
commit 0a6ee8633a
2 changed files with 8 additions and 17 deletions

View File

@@ -2894,8 +2894,7 @@ int LUKS2_deactivate(struct crypt_device *cd, const char *name, struct luks2_hdr
tgt = &dmdc.segment;
while (tgt) {
if (tgt->type == DM_CRYPT)
crypt_unlink_key_by_description_from_thread_keyring(cd, crypt_volume_key_description(tgt->u.crypt.vk),
LOGON_KEY);
crypt_volume_key_drop_kernel_key(cd, tgt->u.crypt.vk);
tgt = tgt->next;
}
}
@@ -2930,8 +2929,7 @@ int LUKS2_deactivate(struct crypt_device *cd, const char *name, struct luks2_hdr
tgt = &dmdc.segment;
while (tgt) {
if (tgt->type == DM_CRYPT)
crypt_unlink_key_by_description_from_thread_keyring(cd, crypt_volume_key_description(tgt->u.crypt.vk),
LOGON_KEY);
crypt_volume_key_drop_kernel_key(cd, tgt->u.crypt.vk);
tgt = tgt->next;
}
}