summaryrefslogtreecommitdiff
path: root/drivers/md/dm-ima.h
diff options
context:
space:
mode:
authorTushar Sugandhi <tusharsu@linux.microsoft.com>2021-08-13 14:37:57 -0700
committerMike Snitzer <snitzer@redhat.com>2021-08-20 15:59:47 -0400
commitdc7b79cc2466805855f554e5f567ea9222b6e33a (patch)
treecf402a5e4d7f97940291d09d2989684f777042bb /drivers/md/dm-ima.h
parent8f509fd4a53ffaf07feeef6dd48cc6bd060ca4f3 (diff)
dm ima: add version info to dm related events in ima log
The DM events present in the ima log contain various attributes in the key=value format. The attributes' names/values may change in future, and new attributes may also get added. The attestation server needs some versioning to determine which attributes are supported and are expected in the ima log. Add version information to the DM events present in the ima log to help attestation servers to correctly process the attributes across different versions. Signed-off-by: Tushar Sugandhi <tusharsu@linux.microsoft.com> Suggested-by: Mimi Zohar <zohar@linux.ibm.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-ima.h')
-rw-r--r--drivers/md/dm-ima.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/dm-ima.h b/drivers/md/dm-ima.h
index 0731a51565d6..b8c3b614670b 100644
--- a/drivers/md/dm-ima.h
+++ b/drivers/md/dm-ima.h
@@ -18,6 +18,14 @@
#define DM_IMA_DEVICE_CAPACITY_BUF_LEN 128
#define DM_IMA_TABLE_HASH_ALG "sha256"
+#define __dm_ima_stringify(s) #s
+#define __dm_ima_str(s) __dm_ima_stringify(s)
+
+#define DM_IMA_VERSION_STR "dm_version=" \
+ __dm_ima_str(DM_VERSION_MAJOR) "." \
+ __dm_ima_str(DM_VERSION_MINOR) "." \
+ __dm_ima_str(DM_VERSION_PATCHLEVEL) ";"
+
#ifdef CONFIG_IMA
struct dm_ima_device_table_metadata {
@@ -46,6 +54,7 @@ struct dm_ima_device_table_metadata {
struct dm_ima_measurements {
struct dm_ima_device_table_metadata active_table;
struct dm_ima_device_table_metadata inactive_table;
+ unsigned int dm_version_str_len;
};
void dm_ima_reset_data(struct mapped_device *md);