From 28cea38d88a4406d0d996df43d82105233e07d47 Mon Sep 17 00:00:00 2001 From: Yuanzheng Song Date: Fri, 24 Jun 2022 10:43:30 +0800 Subject: [PATCH] mm: add an alarm log indicating that soft encryption is not used ohos inclusion category: bugfix issue: #I5DVFK CVE: NA -------------------------------- Add an alarm log indicating that soft encryption is not used when hardware encryption is enabled. Signed-off-by: Yuanzheng Song --- drivers/hyperhold/hp_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hyperhold/hp_device.c b/drivers/hyperhold/hp_device.c index 3eec00dca88b..5b818265c26d 100644 --- a/drivers/hyperhold/hp_device.c +++ b/drivers/hyperhold/hp_device.c @@ -194,6 +194,7 @@ static struct blk_crypto_key *inline_crypto_init(const u8 *key) void inline_crypt_bio(struct blk_crypto_key *blk_key, struct bio *bio) {} static struct blk_crypto_key *inline_crypto_init(const u8 *key) { + pr_err("CONFIG_BLK_INLINE_ENCRYPTION is not enabled!\n"); return NULL; } #endif @@ -210,6 +211,8 @@ bool crypto_init(struct hp_device *dev, bool soft) } else { dev->blk_key = inline_crypto_init(key); ret = dev->blk_key; + if (ret) + pr_warn("soft crypt has been turned off, now apply hard crypt!\n"); } memzero_explicit(key, HP_KEY_SIZE); -- Gitee