From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 230D5442396 for ; Mon, 10 Aug 2026 20:42:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786394522; cv=none; b=EerdQ3wYSHeUjYVDmPiPA/KxrOlvPcnc3KUgq0qxiFNI35tuUWcsAzkGaMm7PxgKcJ/7d+8Ar8yt04MDRupeEvsC2Wt8v0nhiJ/tsdJTZ+PDRxhLmvST1DNp9t7Xyg4nBsZ4mEZrmJz1mCSM4MZgW0pbNCsWn5xMw4mNo4F05s4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786394522; c=relaxed/simple; bh=XtWzZTT4AnJfPX1deXxIUrgprZjuOygWZDcmLRXB3mY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dSMce6yrismo05zmWOEoWKoIywWn8FINNpH3OduJGnAymkRYxAZYLZpvcUx/7/tCrMkiXK0sPfu5C5Mfn38UnNPQMhQjvXWQk3s3Vg42vG81dM9GQAbiKMFDJEVmaqH7Zf+7z/WJc2KDkyjwXi3PNW80QPvPStyB4Yuhoe4Ltzs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=eGsxl4+q; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="eGsxl4+q" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786394507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=JPIIn/AseeGgXI6+lYaSU1ZzHmCj62UnEe5Y0V80ywA=; b=eGsxl4+qF/FKWpUkVHucIkp70pK7RTZJhC9FWpbc8SKQlZWqjYiuBN7Yxj6PY3PBbetyxo FaEtEAfQ1SP29sGNglwnSfTA3Gp3AxFep4A+PQCuSZJgkC6PBylmEm/ieAbPMy9YiFG45g l2Aexf2XYhzahZkPAnxQSKCtBfDksXc= From: Thorsten Blum To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: Thorsten Blum , stable@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] platform/x86: think-lmi: Free system certificate signatures Date: Mon, 10 Aug 2026 22:41:07 +0200 Message-ID: <20260810204106.165895-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1121; i=thorsten.blum@linux.dev; h=from:subject; bh=XtWzZTT4AnJfPX1deXxIUrgprZjuOygWZDcmLRXB3mY=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFlV5kn/tpTFcBydEjyTSVx//xyrL12B/CVhj/Ju/v06W 95SSD+so5SFQYyLQVZMkeXBrB8zfEtrKjeZROyEmcPKBDKEgYtTACaiYM3wT+9kRZnKx2Xny/eZ avB+MzqUlq++s3zC1nbupFu6DInrGBkZ9mxN1dt7//OCif9fTlFW7X55//Xapr1nTVMKSw9XLUp x5wMA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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 --- 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)