[PATCH 2/2] crash_dump: free dm-crypt key description on release
From: Yingjie Wang
Date: Thu Dec 03 2026 - 03:24:42 EST
config_key_release() frees the config_key but not the description
string allocated by config_key_description_store(), so every removed
key directory leaks its description.
Free the description when the item is released.
Fixes: 180cf31af7c3 ("crash_dump: make dm crypt keys persist for the kdump kernel")
Signed-off-by: Yingjie Wang <x-professor@xxxxxxxxxxx>
---
kernel/crash_dump_dm_crypt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/crash_dump_dm_crypt.c b/kernel/crash_dump_dm_crypt.c
index fcfc05edaadc..9f5c2d7c15da 100644
--- a/kernel/crash_dump_dm_crypt.c
+++ b/kernel/crash_dump_dm_crypt.c
@@ -249,6 +249,7 @@ static void config_key_release(struct config_item *item)
{
struct config_key *config_key = to_config_key(item);
+ kfree(config_key->description);
mutex_destroy(&config_key->lock);
kfree(config_key);
key_count--;
--
2.43.0