Skip to content

Commit 1da0893

Browse files
Wang Mingjwrdegoede
authored andcommitted
platform/x86: think-lmi: Use kfree_sensitive instead of kfree
key might contain private part of the key, so better use kfree_sensitive to free it. Signed-off-by: Wang Ming <machel@vivo.com> Link: https://lore.kernel.org/r/20230717101114.18966-1-machel@vivo.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 7783e97 commit 1da0893

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/platform/x86/think-lmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,12 +719,12 @@ static ssize_t cert_to_password_store(struct kobject *kobj,
719719
/* Format: 'Password,Signature' */
720720
auth_str = kasprintf(GFP_KERNEL, "%s,%s", passwd, setting->signature);
721721
if (!auth_str) {
722-
kfree(passwd);
722+
kfree_sensitive(passwd);
723723
return -ENOMEM;
724724
}
725725
ret = tlmi_simple_call(LENOVO_CERT_TO_PASSWORD_GUID, auth_str);
726726
kfree(auth_str);
727-
kfree(passwd);
727+
kfree_sensitive(passwd);
728728

729729
return ret ?: count;
730730
}

0 commit comments

Comments
 (0)