From 7ee0b02967c7524e9cbf90c14d0b058d7d5d29a4 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 6 Feb 2025 15:39:40 +0100 Subject: [PATCH] Make test libdevmapper flags 64bit. --- tests/api_test.h | 64 +++++++++++++++++++++++----------------------- tests/test_utils.c | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/api_test.h b/tests/api_test.h index cbf34b2fb..81eb852cb 100644 --- a/tests/api_test.h +++ b/tests/api_test.h @@ -101,38 +101,38 @@ void xlog(const char *msg, const char *tst, const char *func, int line, const ch #define DIV_ROUND_UP_MODULO(n,d) (DIV_ROUND_UP(n,d)*(d)) /* Device mapper backend - kernel support flags */ -#define T_DM_KEY_WIPE_SUPPORTED (1 << 0) /* key wipe message */ -#define T_DM_LMK_SUPPORTED (1 << 1) /* lmk mode */ -#define T_DM_SECURE_SUPPORTED (1 << 2) /* wipe (secure) buffer flag */ -#define T_DM_PLAIN64_SUPPORTED (1 << 3) /* plain64 IV */ -#define T_DM_DISCARDS_SUPPORTED (1 << 4) /* discards/TRIM option is supported */ -#define T_DM_VERITY_SUPPORTED (1 << 5) /* dm-verity target supported */ -#define T_DM_TCW_SUPPORTED (1 << 6) /* tcw (TCRYPT CBC with whitening) */ -#define T_DM_SAME_CPU_CRYPT_SUPPORTED (1 << 7) /* same_cpu_crypt */ -#define T_DM_SUBMIT_FROM_CRYPT_CPUS_SUPPORTED (1 << 8) /* submit_from_crypt_cpus */ -#define T_DM_VERITY_ON_CORRUPTION_SUPPORTED (1 << 9) /* ignore/restart_on_corruption, ignore_zero_block */ -#define T_DM_VERITY_FEC_SUPPORTED (1 << 10) /* Forward Error Correction (FEC) */ -#define T_DM_KERNEL_KEYRING_SUPPORTED (1 << 11) /* dm-crypt allows loading kernel keyring keys */ -#define T_DM_INTEGRITY_SUPPORTED (1 << 12) /* dm-integrity target supported */ -#define T_DM_SECTOR_SIZE_SUPPORTED (1 << 13) /* support for sector size setting in dm-crypt/dm-integrity */ -#define T_DM_CAPI_STRING_SUPPORTED (1 << 14) /* support for cryptoapi format cipher definition */ -#define T_DM_DEFERRED_SUPPORTED (1 << 15) /* deferred removal of device */ -#define T_DM_INTEGRITY_RECALC_SUPPORTED (1 << 16) /* dm-integrity automatic recalculation supported */ -#define T_DM_INTEGRITY_BITMAP_SUPPORTED (1 << 17) /* dm-integrity bitmap mode supported */ -#define T_DM_GET_TARGET_VERSION_SUPPORTED (1 << 18) /* dm DM_GET_TARGET version ioctl supported */ -#define T_DM_INTEGRITY_FIX_PADDING_SUPPORTED (1 << 19) /* supports the parameter fix_padding that fixes a bug that caused excessive padding */ -#define T_DM_BITLK_EBOIV_SUPPORTED (1 << 20) /* EBOIV for BITLK supported */ -#define T_DM_BITLK_ELEPHANT_SUPPORTED (1 << 21) /* Elephant diffuser for BITLK supported */ -#define T_DM_VERITY_SIGNATURE_SUPPORTED (1 << 22) /* Verity option root_hash_sig_key_desc supported */ -#define T_DM_INTEGRITY_DISCARDS_SUPPORTED (1 << 23) /* dm-integrity discards/TRIM option is supported */ -#define T_DM_INTEGRITY_RESIZE_SUPPORTED (1 << 23) /* dm-integrity resize of the integrity device supported (introduced in the same version as discards)*/ -#define T_DM_VERITY_PANIC_CORRUPTION_SUPPORTED (1 << 24) /* dm-verity panic on corruption */ -#define T_DM_CRYPT_NO_WORKQUEUE_SUPPORTED (1 << 25) /* dm-crypt support for bypassing workqueues */ -#define T_DM_INTEGRITY_FIX_HMAC_SUPPORTED (1 << 26) /* hmac covers also superblock */ -#define T_DM_INTEGRITY_RESET_RECALC_SUPPORTED (1 << 27) /* dm-integrity automatic recalculation supported */ -#define T_DM_VERITY_TASKLETS_SUPPORTED (1 << 28) /* dm-verity tasklets supported */ -#define T_DM_CRYPT_HIGH_PRIORITY_SUPPORTED (1 << 29) /* dm-crypt high priority workqueue flag supported */ -#define T_DM_CRYPT_INTEGRITY_KEY_SIZE_OPT_SUPPORTED (1 << 30) /* dm-crypt support for integrity_key_size option */ +#define T_DM_KEY_WIPE_SUPPORTED (UINT64_C(1) << 0) /* key wipe message */ +#define T_DM_LMK_SUPPORTED (UINT64_C(1) << 1) /* lmk mode */ +#define T_DM_SECURE_SUPPORTED (UINT64_C(1) << 2) /* wipe (secure) buffer flag */ +#define T_DM_PLAIN64_SUPPORTED (UINT64_C(1) << 3) /* plain64 IV */ +#define T_DM_DISCARDS_SUPPORTED (UINT64_C(1) << 4) /* discards/TRIM option is supported */ +#define T_DM_VERITY_SUPPORTED (UINT64_C(1) << 5) /* dm-verity target supported */ +#define T_DM_TCW_SUPPORTED (UINT64_C(1) << 6) /* tcw (TCRYPT CBC with whitening) */ +#define T_DM_SAME_CPU_CRYPT_SUPPORTED (UINT64_C(1) << 7) /* same_cpu_crypt */ +#define T_DM_SUBMIT_FROM_CRYPT_CPUS_SUPPORTED (UINT64_C(1) << 8) /* submit_from_crypt_cpus */ +#define T_DM_VERITY_ON_CORRUPTION_SUPPORTED (UINT64_C(1) << 9) /* ignore/restart_on_corruption, ignore_zero_block */ +#define T_DM_VERITY_FEC_SUPPORTED (UINT64_C(1) << 10) /* Forward Error Correction (FEC) */ +#define T_DM_KERNEL_KEYRING_SUPPORTED (UINT64_C(1) << 11) /* dm-crypt allows loading kernel keyring keys */ +#define T_DM_INTEGRITY_SUPPORTED (UINT64_C(1) << 12) /* dm-integrity target supported */ +#define T_DM_SECTOR_SIZE_SUPPORTED (UINT64_C(1) << 13) /* support for sector size setting in dm-crypt/dm-integrity */ +#define T_DM_CAPI_STRING_SUPPORTED (UINT64_C(1) << 14) /* support for cryptoapi format cipher definition */ +#define T_DM_DEFERRED_SUPPORTED (UINT64_C(1) << 15) /* deferred removal of device */ +#define T_DM_INTEGRITY_RECALC_SUPPORTED (UINT64_C(1) << 16) /* dm-integrity automatic recalculation supported */ +#define T_DM_INTEGRITY_BITMAP_SUPPORTED (UINT64_C(1) << 17) /* dm-integrity bitmap mode supported */ +#define T_DM_GET_TARGET_VERSION_SUPPORTED (UINT64_C(1) << 18) /* dm DM_GET_TARGET version ioctl supported */ +#define T_DM_INTEGRITY_FIX_PADDING_SUPPORTED (UINT64_C(1) << 19) /* supports the parameter fix_padding that fixes a bug that caused excessive padding */ +#define T_DM_BITLK_EBOIV_SUPPORTED (UINT64_C(1) << 20) /* EBOIV for BITLK supported */ +#define T_DM_BITLK_ELEPHANT_SUPPORTED (UINT64_C(1) << 21) /* Elephant diffuser for BITLK supported */ +#define T_DM_VERITY_SIGNATURE_SUPPORTED (UINT64_C(1) << 22) /* Verity option root_hash_sig_key_desc supported */ +#define T_DM_INTEGRITY_DISCARDS_SUPPORTED (UINT64_C(1) << 23) /* dm-integrity discards/TRIM option is supported */ +#define T_DM_INTEGRITY_RESIZE_SUPPORTED (UINT64_C(1) << 23) /* dm-integrity resize of the integrity device supported (introduced in the same version as discards)*/ +#define T_DM_VERITY_PANIC_CORRUPTION_SUPPORTED (UINT64_C(1) << 24) /* dm-verity panic on corruption */ +#define T_DM_CRYPT_NO_WORKQUEUE_SUPPORTED (UINT64_C(1) << 25) /* dm-crypt support for bypassing workqueues */ +#define T_DM_INTEGRITY_FIX_HMAC_SUPPORTED (UINT64_C(1) << 26) /* hmac covers also superblock */ +#define T_DM_INTEGRITY_RESET_RECALC_SUPPORTED (UINT64_C(1) << 27) /* dm-integrity automatic recalculation supported */ +#define T_DM_VERITY_TASKLETS_SUPPORTED (UINT64_C(1) << 28) /* dm-verity tasklets supported */ +#define T_DM_CRYPT_HIGH_PRIORITY_SUPPORTED (UINT64_C(1) << 29) /* dm-crypt high priority workqueue flag supported */ +#define T_DM_CRYPT_INTEGRITY_KEY_SIZE_OPT_SUPPORTED (UINT64_C(1) << 30) /* dm-crypt support for integrity_key_size option */ /* loop helpers */ int loop_device(const char *loop); diff --git a/tests/test_utils.c b/tests/test_utils.c index e98851d85..1011970d6 100644 --- a/tests/test_utils.c +++ b/tests/test_utils.c @@ -41,7 +41,7 @@ struct loop_config { static char last_error[256]; static char global_log[4096]; -static uint32_t t_dm_crypt_flags = 0; +static uint64_t t_dm_crypt_flags = 0; char *THE_LOOP_DEV = NULL; int _debug = 0;