mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86: think-lmi: Free system certificate signatures
@ 2026-08-10 20:41 Thorsten Blum
  2026-08-11 19:28 ` Mark Pearson
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-08-10 20:41 UTC (permalink / raw)
  To: Mark Pearson, Derek J. Clark, Hans de Goede, Ilpo Järvinen
  Cc: Thorsten Blum, stable, platform-driver-x86, linux-kernel

Multi-certificate support also allows the system authentication object
to store ->signature and ->save_signature, which leak when the driver is
removed. Free the signatures to avoid leaking memory.

Fixes: 5dcb5ef12590 ("platform/x86: think-lmi: Multi-certificate support")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/platform/x86/lenovo/think-lmi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index e215e86e3db7..e3e683bf3469 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -1456,6 +1456,10 @@ static void tlmi_release_attr(void)
 	/* Free up any saved signatures */
 	kfree(tlmi_priv.pwd_admin->signature);
 	kfree(tlmi_priv.pwd_admin->save_signature);
+	if (tlmi_priv.pwd_system) {
+		kfree(tlmi_priv.pwd_system->signature);
+		kfree(tlmi_priv.pwd_system->save_signature);
+	}
 
 	/* Authentication structures */
 	list_for_each_entry_safe(pos, n, &tlmi_priv.authentication_kset->list, entry)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86: think-lmi: Free system certificate signatures
  2026-08-10 20:41 [PATCH] platform/x86: think-lmi: Free system certificate signatures Thorsten Blum
@ 2026-08-11 19:28 ` Mark Pearson
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Pearson @ 2026-08-11 19:28 UTC (permalink / raw)
  To: Thorsten Blum, Derek J . Clark, Hans de Goede, Ilpo Järvinen
  Cc: stable, platform-driver-x86, linux-kernel



On Mon, Aug 10, 2026, at 4:41 PM, Thorsten Blum wrote:
> Multi-certificate support also allows the system authentication object
> to store ->signature and ->save_signature, which leak when the driver is
> removed. Free the signatures to avoid leaking memory.
>
> Fixes: 5dcb5ef12590 ("platform/x86: think-lmi: Multi-certificate support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/platform/x86/lenovo/think-lmi.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/platform/x86/lenovo/think-lmi.c 
> b/drivers/platform/x86/lenovo/think-lmi.c
> index e215e86e3db7..e3e683bf3469 100644
> --- a/drivers/platform/x86/lenovo/think-lmi.c
> +++ b/drivers/platform/x86/lenovo/think-lmi.c
> @@ -1456,6 +1456,10 @@ static void tlmi_release_attr(void)
>  	/* Free up any saved signatures */
>  	kfree(tlmi_priv.pwd_admin->signature);
>  	kfree(tlmi_priv.pwd_admin->save_signature);
> +	if (tlmi_priv.pwd_system) {
> +		kfree(tlmi_priv.pwd_system->signature);
> +		kfree(tlmi_priv.pwd_system->save_signature);
> +	}
> 
>  	/* Authentication structures */
>  	list_for_each_entry_safe(pos, n, &tlmi_priv.authentication_kset->list, entry)

Ouch, this one is an embarassing miss for me. Thanks for fixing.
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>

Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-11 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 20:41 [PATCH] platform/x86: think-lmi: Free system certificate signatures Thorsten Blum
2026-08-11 19:28 ` Mark Pearson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®