cryptsetup
2.4.3
About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.
![]() ![]() |
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | dm_target |
struct | crypt_dm_active_device |
Macros | |
#define | DM_RESUME_PRIVATE (1 << 4) /* CRYPT_ACTIVATE_PRIVATE */ |
#define | DM_SUSPEND_SKIP_LOCKFS (1 << 5) |
#define | DM_SUSPEND_WIPE_KEY (1 << 6) |
#define | DM_SUSPEND_NOFLUSH (1 << 7) |
#define | DM_KEY_WIPE_SUPPORTED (1 << 0) /* key wipe message */ |
#define | DM_LMK_SUPPORTED (1 << 1) /* lmk mode */ |
#define | DM_SECURE_SUPPORTED (1 << 2) /* wipe (secure) buffer flag */ |
#define | DM_PLAIN64_SUPPORTED (1 << 3) /* plain64 IV */ |
#define | DM_DISCARDS_SUPPORTED (1 << 4) /* discards/TRIM option is supported */ |
#define | DM_VERITY_SUPPORTED (1 << 5) /* dm-verity target supported */ |
#define | DM_TCW_SUPPORTED (1 << 6) /* tcw (TCRYPT CBC with whitening) */ |
#define | DM_SAME_CPU_CRYPT_SUPPORTED (1 << 7) /* same_cpu_crypt */ |
#define | DM_SUBMIT_FROM_CRYPT_CPUS_SUPPORTED (1 << 8) /* submit_from_crypt_cpus */ |
#define | DM_VERITY_ON_CORRUPTION_SUPPORTED (1 << 9) /* ignore/restart_on_corruption, ignore_zero_block */ |
#define | DM_VERITY_FEC_SUPPORTED (1 << 10) /* Forward Error Correction (FEC) */ |
#define | DM_KERNEL_KEYRING_SUPPORTED (1 << 11) /* dm-crypt allows loading kernel keyring keys */ |
#define | DM_INTEGRITY_SUPPORTED (1 << 12) /* dm-integrity target supported */ |
#define | DM_SECTOR_SIZE_SUPPORTED (1 << 13) /* support for sector size setting in dm-crypt/dm-integrity */ |
#define | DM_CAPI_STRING_SUPPORTED (1 << 14) /* support for cryptoapi format cipher definition */ |
#define | DM_DEFERRED_SUPPORTED (1 << 15) /* deferred removal of device */ |
#define | DM_INTEGRITY_RECALC_SUPPORTED (1 << 16) /* dm-integrity automatic recalculation supported */ |
#define | DM_INTEGRITY_BITMAP_SUPPORTED (1 << 17) /* dm-integrity bitmap mode supported */ |
#define | DM_GET_TARGET_VERSION_SUPPORTED (1 << 18) /* dm DM_GET_TARGET version ioctl supported */ |
#define | DM_INTEGRITY_FIX_PADDING_SUPPORTED (1 << 19) /* supports the parameter fix_padding that fixes a bug that caused excessive padding */ |
#define | DM_BITLK_EBOIV_SUPPORTED (1 << 20) /* EBOIV for BITLK supported */ |
#define | DM_BITLK_ELEPHANT_SUPPORTED (1 << 21) /* Elephant diffuser for BITLK supported */ |
#define | DM_VERITY_SIGNATURE_SUPPORTED (1 << 22) /* Verity option root_hash_sig_key_desc supported */ |
#define | DM_INTEGRITY_DISCARDS_SUPPORTED (1 << 23) /* dm-integrity discards/TRIM option is supported */ |
#define | DM_VERITY_PANIC_CORRUPTION_SUPPORTED (1 << 24) /* dm-verity panic on corruption */ |
#define | DM_CRYPT_NO_WORKQUEUE_SUPPORTED (1 << 25) /* dm-crypt suppot for bypassing workqueues */ |
#define | DM_INTEGRITY_FIX_HMAC_SUPPORTED (1 << 26) /* hmac covers also superblock */ |
#define | DM_INTEGRITY_RESET_RECALC_SUPPORTED (1 << 27) /* dm-integrity automatic recalculation supported */ |
#define | DM_ACTIVE_DEVICE (1 << 0) |
#define | DM_ACTIVE_UUID (1 << 1) |
#define | DM_ACTIVE_HOLDERS (1 << 2) |
#define | DM_ACTIVE_CRYPT_CIPHER (1 << 3) |
#define | DM_ACTIVE_CRYPT_KEYSIZE (1 << 4) |
#define | DM_ACTIVE_CRYPT_KEY (1 << 5) |
#define | DM_ACTIVE_VERITY_ROOT_HASH (1 << 6) |
#define | DM_ACTIVE_VERITY_HASH_DEVICE (1 << 7) |
#define | DM_ACTIVE_VERITY_PARAMS (1 << 8) |
#define | DM_ACTIVE_INTEGRITY_PARAMS (1 << 9) |
Enumerations | |
enum | dm_target_type { DM_CRYPT = 0 , DM_VERITY , DM_INTEGRITY , DM_LINEAR , DM_ERROR , DM_ZERO , DM_UNKNOWN } |
enum | tdirection { TARGET_SET = 1 , TARGET_QUERY } |
Functions | |
static uint32_t | act2dmflags (uint32_t act_flags) |
int | dm_flags (struct crypt_device *cd, dm_target_type target, uint32_t *flags) |
static bool | single_segment (const struct crypt_dm_active_device *dmd) |
void | dm_backend_init (struct crypt_device *cd) |
void | dm_backend_exit (struct crypt_device *cd) |
int | dm_targets_allocate (struct dm_target *first, unsigned count) |
void | dm_targets_free (struct crypt_device *cd, struct crypt_dm_active_device *dmd) |
int | dm_crypt_target_set (struct dm_target *tgt, uint64_t seg_offset, uint64_t seg_size, struct device *data_device, struct volume_key *vk, const char *cipher, uint64_t iv_offset, uint64_t data_offset, const char *integrity, uint32_t tag_size, uint32_t sector_size) |
int | dm_verity_target_set (struct dm_target *tgt, uint64_t seg_offset, uint64_t seg_size, struct device *data_device, struct device *hash_device, struct device *fec_device, const char *root_hash, uint32_t root_hash_size, const char *root_hash_sig_key_desc, uint64_t hash_offset_block, uint64_t fec_blocks, struct crypt_params_verity *vp) |
int | dm_integrity_target_set (struct crypt_device *cd, struct dm_target *tgt, uint64_t seg_offset, uint64_t seg_size, struct device *meta_device, struct device *data_device, uint64_t tag_size, uint64_t offset, uint32_t sector_size, struct volume_key *vk, struct volume_key *journal_crypt_key, struct volume_key *journal_mac_key, const struct crypt_params_integrity *ip) |
int | dm_linear_target_set (struct dm_target *tgt, uint64_t seg_offset, uint64_t seg_size, struct device *data_device, uint64_t data_offset) |
int | dm_zero_target_set (struct dm_target *tgt, uint64_t seg_offset, uint64_t seg_size) |
int | dm_remove_device (struct crypt_device *cd, const char *name, uint32_t flags) |
int | dm_status_device (struct crypt_device *cd, const char *name) |
int | dm_status_suspended (struct crypt_device *cd, const char *name) |
int | dm_status_verity_ok (struct crypt_device *cd, const char *name) |
int | dm_status_integrity_failures (struct crypt_device *cd, const char *name, uint64_t *count) |
int | dm_query_device (struct crypt_device *cd, const char *name, uint32_t get_flags, struct crypt_dm_active_device *dmd) |
int | dm_device_deps (struct crypt_device *cd, const char *name, const char *prefix, char **names, size_t names_length) |
int | dm_create_device (struct crypt_device *cd, const char *name, const char *type, struct crypt_dm_active_device *dmd) |
int | dm_reload_device (struct crypt_device *cd, const char *name, struct crypt_dm_active_device *dmd, uint32_t dmflags, unsigned resume) |
int | dm_suspend_device (struct crypt_device *cd, const char *name, uint32_t dmflags) |
int | dm_resume_device (struct crypt_device *cd, const char *name, uint32_t dmflags) |
int | dm_resume_and_reinstate_key (struct crypt_device *cd, const char *name, const struct volume_key *vk) |
int | dm_error_device (struct crypt_device *cd, const char *name) |
int | dm_clear_device (struct crypt_device *cd, const char *name) |
int | dm_cancel_deferred_removal (const char *name) |
const char * | dm_get_dir (void) |
int | lookup_dm_dev_by_uuid (struct crypt_device *cd, const char *uuid, const char *type) |
int | dm_is_dm_device (int major) |
int | dm_is_dm_kernel_name (const char *name) |
char * | dm_device_path (const char *prefix, int major, int minor) |
char * | dm_device_name (const char *path) |
#define DM_ACTIVE_CRYPT_CIPHER (1 << 3) |
Definition at line 87 of file utils_dm.h.
#define DM_ACTIVE_CRYPT_KEY (1 << 5) |
Definition at line 89 of file utils_dm.h.
#define DM_ACTIVE_CRYPT_KEYSIZE (1 << 4) |
Definition at line 88 of file utils_dm.h.
#define DM_ACTIVE_DEVICE (1 << 0) |
Definition at line 83 of file utils_dm.h.
#define DM_ACTIVE_HOLDERS (1 << 2) |
Definition at line 85 of file utils_dm.h.
#define DM_ACTIVE_INTEGRITY_PARAMS (1 << 9) |
Definition at line 95 of file utils_dm.h.
#define DM_ACTIVE_UUID (1 << 1) |
Definition at line 84 of file utils_dm.h.
#define DM_ACTIVE_VERITY_HASH_DEVICE (1 << 7) |
Definition at line 92 of file utils_dm.h.
#define DM_ACTIVE_VERITY_PARAMS (1 << 8) |
Definition at line 93 of file utils_dm.h.
#define DM_ACTIVE_VERITY_ROOT_HASH (1 << 6) |
Definition at line 91 of file utils_dm.h.
#define DM_BITLK_EBOIV_SUPPORTED (1 << 20) /* EBOIV for BITLK supported */ |
Definition at line 69 of file utils_dm.h.
#define DM_BITLK_ELEPHANT_SUPPORTED (1 << 21) /* Elephant diffuser for BITLK supported */ |
Definition at line 70 of file utils_dm.h.
#define DM_CAPI_STRING_SUPPORTED (1 << 14) /* support for cryptoapi format cipher definition */ |
Definition at line 63 of file utils_dm.h.
#define DM_CRYPT_NO_WORKQUEUE_SUPPORTED (1 << 25) /* dm-crypt suppot for bypassing workqueues */ |
Definition at line 74 of file utils_dm.h.
#define DM_DEFERRED_SUPPORTED (1 << 15) /* deferred removal of device */ |
Definition at line 64 of file utils_dm.h.
#define DM_DISCARDS_SUPPORTED (1 << 4) /* discards/TRIM option is supported */ |
Definition at line 53 of file utils_dm.h.
#define DM_GET_TARGET_VERSION_SUPPORTED (1 << 18) /* dm DM_GET_TARGET version ioctl supported */ |
Definition at line 67 of file utils_dm.h.
#define DM_INTEGRITY_BITMAP_SUPPORTED (1 << 17) /* dm-integrity bitmap mode supported */ |
Definition at line 66 of file utils_dm.h.
#define DM_INTEGRITY_DISCARDS_SUPPORTED (1 << 23) /* dm-integrity discards/TRIM option is supported */ |
Definition at line 72 of file utils_dm.h.
#define DM_INTEGRITY_FIX_HMAC_SUPPORTED (1 << 26) /* hmac covers also superblock */ |
Definition at line 75 of file utils_dm.h.
#define DM_INTEGRITY_FIX_PADDING_SUPPORTED (1 << 19) /* supports the parameter fix_padding that fixes a bug that caused excessive padding */ |
Definition at line 68 of file utils_dm.h.
#define DM_INTEGRITY_RECALC_SUPPORTED (1 << 16) /* dm-integrity automatic recalculation supported */ |
Definition at line 65 of file utils_dm.h.
#define DM_INTEGRITY_RESET_RECALC_SUPPORTED (1 << 27) /* dm-integrity automatic recalculation supported */ |
Definition at line 76 of file utils_dm.h.
#define DM_INTEGRITY_SUPPORTED (1 << 12) /* dm-integrity target supported */ |
Definition at line 61 of file utils_dm.h.
#define DM_KERNEL_KEYRING_SUPPORTED (1 << 11) /* dm-crypt allows loading kernel keyring keys */ |
Definition at line 60 of file utils_dm.h.
#define DM_KEY_WIPE_SUPPORTED (1 << 0) /* key wipe message */ |
Definition at line 49 of file utils_dm.h.
#define DM_LMK_SUPPORTED (1 << 1) /* lmk mode */ |
Definition at line 50 of file utils_dm.h.
#define DM_PLAIN64_SUPPORTED (1 << 3) /* plain64 IV */ |
Definition at line 52 of file utils_dm.h.
#define DM_RESUME_PRIVATE (1 << 4) /* CRYPT_ACTIVATE_PRIVATE */ |
Definition at line 38 of file utils_dm.h.
#define DM_SAME_CPU_CRYPT_SUPPORTED (1 << 7) /* same_cpu_crypt */ |
Definition at line 56 of file utils_dm.h.
#define DM_SECTOR_SIZE_SUPPORTED (1 << 13) /* support for sector size setting in dm-crypt/dm-integrity */ |
Definition at line 62 of file utils_dm.h.
#define DM_SECURE_SUPPORTED (1 << 2) /* wipe (secure) buffer flag */ |
Definition at line 51 of file utils_dm.h.
#define DM_SUBMIT_FROM_CRYPT_CPUS_SUPPORTED (1 << 8) /* submit_from_crypt_cpus */ |
Definition at line 57 of file utils_dm.h.
#define DM_SUSPEND_NOFLUSH (1 << 7) |
Definition at line 41 of file utils_dm.h.
#define DM_SUSPEND_SKIP_LOCKFS (1 << 5) |
Definition at line 39 of file utils_dm.h.
#define DM_SUSPEND_WIPE_KEY (1 << 6) |
Definition at line 40 of file utils_dm.h.
#define DM_TCW_SUPPORTED (1 << 6) /* tcw (TCRYPT CBC with whitening) */ |
Definition at line 55 of file utils_dm.h.
#define DM_VERITY_FEC_SUPPORTED (1 << 10) /* Forward Error Correction (FEC) */ |
Definition at line 59 of file utils_dm.h.
#define DM_VERITY_ON_CORRUPTION_SUPPORTED (1 << 9) /* ignore/restart_on_corruption, ignore_zero_block */ |
Definition at line 58 of file utils_dm.h.
#define DM_VERITY_PANIC_CORRUPTION_SUPPORTED (1 << 24) /* dm-verity panic on corruption */ |
Definition at line 73 of file utils_dm.h.
#define DM_VERITY_SIGNATURE_SUPPORTED (1 << 22) /* Verity option root_hash_sig_key_desc supported */ |
Definition at line 71 of file utils_dm.h.
#define DM_VERITY_SUPPORTED (1 << 5) /* dm-verity target supported */ |
Definition at line 54 of file utils_dm.h.
enum dm_target_type |
Enumerator | |
---|---|
DM_CRYPT | |
DM_VERITY | |
DM_INTEGRITY | |
DM_LINEAR | |
DM_ERROR | |
DM_ZERO | |
DM_UNKNOWN |
Definition at line 78 of file utils_dm.h.
enum tdirection |
Enumerator | |
---|---|
TARGET_SET | |
TARGET_QUERY |
Definition at line 79 of file utils_dm.h.
|
inlinestatic |
Definition at line 43 of file utils_dm.h.
References DM_RESUME_PRIVATE.
Referenced by _reload_device_with_integrity(), and dm_reload_device().
void dm_backend_exit | ( | struct crypt_device * | cd | ) |
Definition at line 380 of file libdevmapper.c.
References _dm_use_count, log_dbg, and NULL.
Referenced by crypt_free(), crypt_status(), and crypt_suspend().
void dm_backend_init | ( | struct crypt_device * | cd | ) |
Definition at line 371 of file libdevmapper.c.
References _dm_use_count, log_dbg, and set_dm_error().
Referenced by crypt_init(), crypt_status(), and crypt_suspend().
int dm_cancel_deferred_removal | ( | const char * | name | ) |
Definition at line 2993 of file libdevmapper.c.
References _dm_message(), and name.
Referenced by crypt_deactivate_by_name().
int dm_clear_device | ( | struct crypt_device * | cd, |
const char * | name | ||
) |
Definition at line 1134 of file libdevmapper.c.
References _dm_simple(), dm_exit_context(), dm_init_context(), DM_UNKNOWN, and name.
Referenced by _reload_device_with_integrity().
int dm_create_device | ( | struct crypt_device * | cd, |
const char * | name, | ||
const char * | type, | ||
struct crypt_dm_active_device * | dmd | ||
) |
Definition at line 1656 of file libdevmapper.c.
References _, _dm_create_device(), check_retry(), dm_target::cipher, dm_target::crypt, CRYPT_ACTIVATE_ALLOW_DISCARDS, CRYPT_ACTIVATE_CHECK_AT_MOST_ONCE, CRYPT_ACTIVATE_IGNORE_CORRUPTION, CRYPT_ACTIVATE_IGNORE_ZERO_BLOCKS, CRYPT_ACTIVATE_NO_JOURNAL_BITMAP, CRYPT_ACTIVATE_NO_READ_WORKQUEUE, CRYPT_ACTIVATE_NO_WRITE_WORKQUEUE, CRYPT_ACTIVATE_PANIC_ON_CORRUPTION, CRYPT_ACTIVATE_PRIVATE, CRYPT_ACTIVATE_RECALCULATE, CRYPT_ACTIVATE_RECALCULATE_RESET, CRYPT_ACTIVATE_RESTART_ON_CORRUPTION, CRYPT_ACTIVATE_SAME_CPU_CRYPT, CRYPT_ACTIVATE_SUBMIT_FROM_CRYPT_CPUS, crypt_is_cipher_null(), DM_CRYPT, DM_CRYPT_NO_WORKQUEUE_SUPPORTED, dm_exit_context(), dm_flags(), dm_init_context(), DM_INTEGRITY, DM_INTEGRITY_BITMAP_SUPPORTED, DM_INTEGRITY_DISCARDS_SUPPORTED, DM_INTEGRITY_RECALC_SUPPORTED, DM_INTEGRITY_RESET_RECALC_SUPPORTED, DM_INTEGRITY_SUPPORTED, DM_LINEAR, DM_SAME_CPU_CRYPT_SUPPORTED, DM_SECTOR_SIZE_SUPPORTED, DM_SUBMIT_FROM_CRYPT_CPUS_SUPPORTED, DM_VERITY, DM_VERITY_FEC_SUPPORTED, DM_VERITY_ON_CORRUPTION_SUPPORTED, DM_VERITY_PANIC_CORRUPTION_SUPPORTED, DM_ZERO, dm_target::fec_device, crypt_dm_active_device::flags, dm_target::integrity, log_dbg, log_err, name, SECTOR_SIZE, dm_target::sector_size, crypt_dm_active_device::segment, single_segment(), dm_target::type, dm_target::u, and dm_target::verity.
Referenced by _activate(), _create_device_with_integrity(), create_or_reload_device(), crypt_storage_dmcrypt_init(), INTEGRITY_activate_dmd_device(), INTEGRITY_format(), LOOPAES_activate(), LUKS2_activate_multi(), LUKS_endec_template(), TCRYPT_activate(), and VERITY_activate().
int dm_crypt_target_set | ( | struct dm_target * | tgt, |
uint64_t | seg_offset, | ||
uint64_t | seg_size, | ||
struct device * | data_device, | ||
struct volume_key * | vk, | ||
const char * | cipher, | ||
uint64_t | iv_offset, | ||
uint64_t | data_offset, | ||
const char * | integrity, | ||
uint32_t | tag_size, | ||
uint32_t | sector_size | ||
) |
Definition at line 3013 of file libdevmapper.c.
References dm_target::cipher, dm_target::crypt, dm_target::data_device, dm_target::direction, DM_CRYPT, dm_target::integrity, dm_target::iv_offset, NULL, dm_target::offset, dm_target::sector_size, sector_size, dm_target::size, dm_target::tag_size, TARGET_SET, dm_target::type, dm_target::u, and dm_target::vk.
Referenced by _activate(), crypt_resize(), crypt_storage_dmcrypt_init(), LOOPAES_activate(), LUKS1_activate(), LUKS2_activate(), LUKS2_assembly_multisegment_dmd(), LUKS_endec_template(), PLAIN_activate(), and TCRYPT_activate().
int dm_device_deps | ( | struct crypt_device * | cd, |
const char * | name, | ||
const char * | prefix, | ||
char ** | names, | ||
size_t | names_length | ||
) |
Definition at line 2812 of file libdevmapper.c.
References _process_deps(), dm_exit_context(), dm_init_context(), DM_UNKNOWN, name, and NULL.
Referenced by _init_by_name_crypt(), and LUKS2_deactivate().
char * dm_device_name | ( | const char * | path | ) |
Definition at line 437 of file libdevmapper.c.
References dm_device_path(), and NULL.
char * dm_device_path | ( | const char * | prefix, |
int | major, | ||
int | minor | ||
) |
Definition at line 412 of file libdevmapper.c.
Referenced by crypt_lookup_dev(), and dm_device_name().
int dm_error_device | ( | struct crypt_device * | cd, |
const char * | name | ||
) |
Definition at line 1111 of file libdevmapper.c.
References _error_device(), dm_exit_context(), dm_init_context(), dm_query_device(), dm_targets_free(), DM_UNKNOWN, name, and crypt_dm_active_device::size.
Referenced by _reload_device_with_integrity(), and LUKS2_deactivate().
int dm_flags | ( | struct crypt_device * | cd, |
dm_target_type | target, | ||
uint32_t * | flags | ||
) |
Definition at line 352 of file libdevmapper.c.
References _dm_check_versions(), _dm_crypt_checked, _dm_flags, _dm_integrity_checked, _dm_verity_checked, DM_CRYPT, DM_INTEGRITY, DM_LINEAR, DM_UNKNOWN, DM_VERITY, and DM_ZERO.
Referenced by _activate(), _crypt_format_luks2(), crypt_use_keyring_for_vk(), dm_create_device(), dm_integrity_target_set(), dm_reload_device(), dm_remove_device(), dm_resume_and_reinstate_key(), dm_suspend_device(), INTEGRITY_activate_dmd_device(), INTEGRITY_format(), LOOPAES_activate(), TCRYPT_activate(), and VERITY_activate().
const char * dm_get_dir | ( | void | ) |
Definition at line 2998 of file libdevmapper.c.
Referenced by _init_by_name_crypt(), create_or_reload_device_with_integrity(), crypt_get_dir(), crypt_storage_dmcrypt_init(), device_dm_name(), lookup_dev_old(), LUKS_endec_template(), and TCRYPT_activate().
int dm_integrity_target_set | ( | struct crypt_device * | cd, |
struct dm_target * | tgt, | ||
uint64_t | seg_offset, | ||
uint64_t | seg_size, | ||
struct device * | meta_device, | ||
struct device * | data_device, | ||
uint64_t | tag_size, | ||
uint64_t | offset, | ||
uint32_t | sector_size, | ||
struct volume_key * | vk, | ||
struct volume_key * | journal_crypt_key, | ||
struct volume_key * | journal_mac_key, | ||
const struct crypt_params_integrity * | ip | ||
) |
Definition at line 3072 of file libdevmapper.c.
References _dm_check_versions(), crypt_params_integrity::buffer_sectors, CRYPT_COMPAT_LEGACY_INTEGRITY_HMAC, CRYPT_COMPAT_LEGACY_INTEGRITY_PADDING, CRYPT_COMPAT_LEGACY_INTEGRITY_RECALC, crypt_get_compatibility(), dm_target::data_device, dm_target::direction, dm_flags(), DM_INTEGRITY, DM_INTEGRITY_FIX_HMAC_SUPPORTED, DM_INTEGRITY_FIX_PADDING_SUPPORTED, crypt_params_integrity::integrity, dm_target::integrity, crypt_params_integrity::interleave_sectors, crypt_params_integrity::journal_commit_time, crypt_params_integrity::journal_crypt, crypt_params_integrity::journal_integrity, crypt_params_integrity::journal_size, crypt_params_integrity::journal_watermark, dm_target::offset, sector_size, dm_target::size, TARGET_SET, dm_target::type, and dm_target::u.
Referenced by INTEGRITY_create_dmd_device(), and INTEGRITY_format().
int dm_is_dm_device | ( | int | major | ) |
Definition at line 3003 of file libdevmapper.c.
Referenced by lookup_dev_old().
int dm_is_dm_kernel_name | ( | const char * | name | ) |
Definition at line 3008 of file libdevmapper.c.
References name.
Referenced by __lookup_dev(), crypt_get_base_device(), crypt_get_partition_device(), and crypt_lookup_dev().
int dm_linear_target_set | ( | struct dm_target * | tgt, |
uint64_t | seg_offset, | ||
uint64_t | seg_size, | ||
struct device * | data_device, | ||
uint64_t | data_offset | ||
) |
Definition at line 3130 of file libdevmapper.c.
References dm_target::data_device, dm_target::direction, DM_LINEAR, dm_target::linear, dm_target::offset, dm_target::size, TARGET_SET, dm_target::type, and dm_target::u.
Referenced by LUKS2_assembly_multisegment_dmd().
int dm_query_device | ( | struct crypt_device * | cd, |
const char * | name, | ||
uint32_t | get_flags, | ||
struct crypt_dm_active_device * | dmd | ||
) |
Definition at line 2747 of file libdevmapper.c.
References _dm_query_device(), dm_exit_context(), dm_init_context(), DM_UNKNOWN, and name.
Referenced by _init_by_name_crypt(), _init_by_name_crypt_none(), _init_by_name_integrity(), _init_by_name_verity(), _reload_device(), _reload_device_with_integrity(), crypt_deactivate_by_name(), crypt_get_active_device(), crypt_get_active_integrity_failures(), crypt_get_device_key_description(), crypt_init_by_name_and_header(), crypt_resize(), crypt_uuid_type_cmp(), dm_error_device(), dm_remove_device(), LUKS2_deactivate(), TCRYPT_deactivate(), TCRYPT_remove_one(), and TCRYPT_status_one().
int dm_reload_device | ( | struct crypt_device * | cd, |
const char * | name, | ||
struct crypt_dm_active_device * | dmd, | ||
uint32_t | dmflags, | ||
unsigned | resume | ||
) |
Definition at line 1740 of file libdevmapper.c.
References _, _dm_reload_device(), _dm_resume_device(), act2dmflags(), CRYPT_ACTIVATE_ALLOW_DISCARDS, CRYPT_ACTIVATE_NO_READ_WORKQUEUE, CRYPT_ACTIVATE_NO_WRITE_WORKQUEUE, CRYPT_ACTIVATE_SAME_CPU_CRYPT, CRYPT_ACTIVATE_SUBMIT_FROM_CRYPT_CPUS, DM_CRYPT, DM_CRYPT_NO_WORKQUEUE_SUPPORTED, DM_DISCARDS_SUPPORTED, dm_exit_context(), dm_flags(), dm_init_context(), DM_INTEGRITY, DM_INTEGRITY_DISCARDS_SUPPORTED, DM_INTEGRITY_RECALC_SUPPORTED, DM_LINEAR, DM_SAME_CPU_CRYPT_SUPPORTED, DM_SUBMIT_FROM_CRYPT_CPUS_SUPPORTED, crypt_dm_active_device::flags, log_err, name, crypt_dm_active_device::segment, and dm_target::type.
Referenced by _reload_custom_multi(), _reload_device(), and _reload_device_with_integrity().
int dm_remove_device | ( | struct crypt_device * | cd, |
const char * | name, | ||
uint32_t | flags | ||
) |
Definition at line 1154 of file libdevmapper.c.
References _, _dm_remove(), _error_device(), CRYPT_DEACTIVATE_DEFERRED, CRYPT_DEACTIVATE_FORCE, DM_DEFERRED_SUPPORTED, dm_exit_context(), dm_flags(), dm_init_context(), dm_query_device(), DM_UNKNOWN, crypt_dm_active_device::flags, log_dbg, log_err, name, RETRY_COUNT, and crypt_dm_active_device::size.
Referenced by _create_device_with_integrity(), crypt_deactivate_by_name(), crypt_storage_dmcrypt_init(), crypt_storage_wrapper_destroy(), INTEGRITY_format(), LUKS2_deactivate(), LUKS_endec_template(), TCRYPT_deactivate(), and TCRYPT_remove_one().
int dm_resume_and_reinstate_key | ( | struct crypt_device * | cd, |
const char * | name, | ||
const struct volume_key * | vk | ||
) |
Definition at line 2946 of file libdevmapper.c.
References _dm_message(), _dm_resume_device(), crypt_safe_alloc(), crypt_safe_free(), DM_CRYPT, dm_exit_context(), dm_flags(), dm_init_context(), DM_KEY_WIPE_SUPPORTED, hex_key(), int_log10(), volume_key::key, volume_key::key_description, volume_key::keylength, name, and NULL.
Referenced by resume_by_volume_key().
int dm_resume_device | ( | struct crypt_device * | cd, |
const char * | name, | ||
uint32_t | dmflags | ||
) |
Definition at line 2932 of file libdevmapper.c.
References _dm_resume_device(), dm_exit_context(), dm_init_context(), DM_UNKNOWN, and name.
Referenced by _reload_device_with_integrity().
int dm_status_device | ( | struct crypt_device * | cd, |
const char * | name | ||
) |
Definition at line 1835 of file libdevmapper.c.
References dm_exit_context(), dm_init_context(), dm_status_dmi(), DM_UNKNOWN, name, and NULL.
Referenced by _activate_check_status(), _dm_create_device(), check_devices(), crypt_status(), TCRYPT_remove_one(), and TCRYPT_status_one().
int dm_status_integrity_failures | ( | struct crypt_device * | cd, |
const char * | name, | ||
uint64_t * | count | ||
) |
Definition at line 1905 of file libdevmapper.c.
References dm_exit_context(), dm_init_context(), DM_INTEGRITY, DM_INTEGRITY_TARGET, dm_status_dmi(), log_dbg, name, and NULL.
Referenced by crypt_get_active_integrity_failures().
int dm_status_suspended | ( | struct crypt_device * | cd, |
const char * | name | ||
) |
Definition at line 1859 of file libdevmapper.c.
References dm_exit_context(), dm_init_context(), dm_status_dmi(), DM_UNKNOWN, name, and NULL.
Referenced by _reload_device_with_integrity(), crypt_resume_by_keyfile_device_offset(), crypt_resume_by_passphrase(), crypt_resume_by_volume_key(), crypt_suspend(), and LUKS2_deactivate().
int dm_status_verity_ok | ( | struct crypt_device * | cd, |
const char * | name | ||
) |
Definition at line 1894 of file libdevmapper.c.
References _dm_status_verity_ok(), dm_exit_context(), dm_init_context(), DM_VERITY, and name.
Referenced by VERITY_activate().
int dm_suspend_device | ( | struct crypt_device * | cd, |
const char * | name, | ||
uint32_t | dmflags | ||
) |
Definition at line 2898 of file libdevmapper.c.
References _dm_message(), _dm_resume_device(), _dm_simple(), DM_CRYPT, dm_exit_context(), dm_flags(), dm_init_context(), DM_KEY_WIPE_SUPPORTED, DM_SUSPEND_WIPE_KEY, DM_UNKNOWN, and name.
Referenced by _reload_device_with_integrity(), and crypt_suspend().
int dm_targets_allocate | ( | struct dm_target * | first, |
unsigned | count | ||
) |
Definition at line 1602 of file libdevmapper.c.
References crypt_zalloc(), and dm_target::next.
Referenced by _activate(), _dm_query_device(), and LUKS2_assembly_multisegment_dmd().
void dm_targets_free | ( | struct crypt_device * | cd, |
struct crypt_dm_active_device * | dmd | ||
) |
Definition at line 1586 of file libdevmapper.c.
References _dm_target_erase(), dm_target::next, and crypt_dm_active_device::segment.
Referenced by _activate(), _dm_query_device(), _init_by_name_crypt(), _init_by_name_crypt_none(), _init_by_name_integrity(), _init_by_name_verity(), _process_deps(), _reload_custom_multi(), _reload_device(), _reload_device_with_integrity(), crypt_deactivate_by_name(), crypt_get_active_device(), crypt_get_active_integrity_failures(), crypt_get_device_key_description(), crypt_init_by_name_and_header(), crypt_resize(), crypt_storage_dmcrypt_init(), dm_error_device(), INTEGRITY_activate(), INTEGRITY_format(), LOOPAES_activate(), LUKS1_activate(), LUKS2_activate(), LUKS2_activate_multi(), LUKS2_assembly_multisegment_dmd(), LUKS2_deactivate(), LUKS_endec_template(), PLAIN_activate(), TCRYPT_activate(), TCRYPT_status_one(), and VERITY_activate().
int dm_verity_target_set | ( | struct dm_target * | tgt, |
uint64_t | seg_offset, | ||
uint64_t | seg_size, | ||
struct device * | data_device, | ||
struct device * | hash_device, | ||
struct device * | fec_device, | ||
const char * | root_hash, | ||
uint32_t | root_hash_size, | ||
const char * | root_hash_sig_key_desc, | ||
uint64_t | hash_offset_block, | ||
uint64_t | fec_blocks, | ||
struct crypt_params_verity * | vp | ||
) |
Definition at line 3045 of file libdevmapper.c.
References dm_target::data_device, dm_target::direction, DM_VERITY, crypt_params_verity::fec_area_offset, dm_target::fec_blocks, dm_target::fec_device, dm_target::fec_offset, crypt_params_verity::hash_block_size, dm_target::hash_device, dm_target::hash_offset, dm_target::offset, dm_target::root_hash, dm_target::root_hash_sig_key_desc, dm_target::root_hash_size, dm_target::size, TARGET_SET, dm_target::type, dm_target::u, dm_target::verity, and dm_target::vp.
Referenced by VERITY_activate().
int dm_zero_target_set | ( | struct dm_target * | tgt, |
uint64_t | seg_offset, | ||
uint64_t | seg_size | ||
) |
Definition at line 3147 of file libdevmapper.c.
References dm_target::direction, DM_ZERO, dm_target::offset, dm_target::size, TARGET_SET, and dm_target::type.
Referenced by _activate().
int lookup_dm_dev_by_uuid | ( | struct crypt_device * | cd, |
const char * | uuid, | ||
const char * | type | ||
) |
Definition at line 1244 of file libdevmapper.c.
References c, DM_BY_ID_PREFIX, DM_BY_ID_PREFIX_LEN, dm_prepare_uuid(), DM_UUID_LEN, lookup_by_disk_id(), lookup_by_sysfs_uuid_field(), and crypt_dm_active_device::uuid.
Referenced by luks_header_in_use().
|
inlinestatic |
Definition at line 177 of file utils_dm.h.
References dm_target::next, and crypt_dm_active_device::segment.
Referenced by _create_device_with_integrity(), _init_by_name_crypt(), _init_by_name_crypt_none(), _init_by_name_integrity(), _init_by_name_verity(), _reload_device(), _reload_device_with_integrity(), create_or_reload_device(), crypt_get_active_device(), crypt_get_active_integrity_failures(), crypt_get_device_key_description(), crypt_resize(), dm_create_device(), INTEGRITY_activate_dmd_device(), LUKS2_deactivate(), and TCRYPT_status_one().