From e1a7e772699216121dd8fa774381ffeedb076139 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 25 Jan 2019 12:11:25 -0800 Subject: [PATCH] cryptfs: improve logging of dm-crypt device creation Log the main configuration of the dm-crypt device -- the name, the cipher, the keysize, the real device, and the length -- in addition to the extra parameters which we were already logging. (We can't simply log the actual string passed to the kernel, of course, because that includes the key. So we choose the fields individually.) Test: booted device configured to use FDE and checked the log message Change-Id: Ia95de807c4fad68d93b7e7e73508a01e5139dc76 --- cryptfs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cryptfs.cpp b/cryptfs.cpp index 01ac694..7c33449 100644 --- a/cryptfs.cpp +++ b/cryptfs.cpp @@ -984,7 +984,10 @@ static int load_crypto_mapping_table(struct crypt_mnt_ftr* crypt_ftr, convert_key_to_hex_ascii(master_key, crypt_ftr->keysize, master_key_ascii); buff_offset = crypt_params - buffer; - SLOGI("Extra parameters for dm_crypt: %s\n", extra_params); + SLOGI( + "Creating crypto dev \"%s\"; cipher=%s, keysize=%u, real_dev=%s, len=%llu, params=\"%s\"\n", + name, crypt_ftr->crypto_type_name, crypt_ftr->keysize, real_blk_name, tgt->length * 512, + extra_params); snprintf(crypt_params, sizeof(buffer) - buff_offset, "%s %s 0 %s 0 %s", crypt_ftr->crypto_type_name, master_key_ascii, real_blk_name, extra_params); crypt_params += strlen(crypt_params) + 1;