From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382880; b=d8R69qsWjjnO+0plzaNhX16Bmybkth+kTaju1mutYSO4We+bQApomb4RA4yvxoHoU/De erSNKRlwDrLhTIf1t4PGkGVEmVJbK7IgJaWSRKDqNAk88RWLWgtBHkI8bW9SMIlmbLZBC kKyIYLd77XiXbojaYomyxCflXtGGPGdfNoWEmsHcuKUjf/H/Gs6Aq2S+nLhDVRnDxSaKJ p8Z0zWcwBQmQQbTJcuQQBBVR6M10qSI+AVpJy6mNPnPSQR7Zw+ZY5Y7vu/C5Fa17AJwi7 LLRxBVfZ/2/1+2Z8mL5UBXyNMtbxez9ok//VJCa8W4TohbX6UtgMcSyV7Jmnd7oaXQw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382880; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=I+weCWCts+VOPFwcXknV0rwQjeaFuW6BNTStBiu4gSg=; b=t26Eg1WBDS4v+bzvMFrgH7cC8LBT9GiJLu+BGbAAM8pE813tQ0Mg/Lzyu5hUvdVKQl1k OfHfVaKNiW20Vo7trGIgIvyCZxcHsdp4Uy3vxwgzmJG704n2v6EC9ydkxWTmUXZ+/yC1u WVlCXKV/7Um3l0CXXFn86E6KoMBasqTaBxgOckcB+LPyAH6jGMj4QtzA0/OB8gC06yp8H 9iDjC4GBwevcWXmlMububyxf5idXIzlqh1Hf1a70580L9Dhg0yBqAkvTI92PpXBcQ8ayJ qpLCxdWZIoRN0ZicUR8A+CbY6LLiHYOFdhOHywtyNehcmOTRsrjcodE0uJCPzxiTKYQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=XXvCkGYw; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A425F606A322; Fri, 4 Dec 2026 11:14:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=XXvCkGYw Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15BB51F000C2; Fri, 4 Dec 2026 11:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382880; bh=I+weCWCts+VOPFwcXknV0rwQjeaFuW6BNTStBiu4gSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XXvCkGYw8zNoM0wpsRJlvzqp4mDxUGjtNi1wzTzzlWRUtKuBUCDnBXekexko1qxmx zZVz9YgSRGFrMU92sV3kOAOKGfpStutN9uByOsfbQvOXfdtrtsp4llnRhm6GND0Luz zF4YYAxDsUj2jkvnwBreoa8cWf7R7XMhi/1srWXA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guicai Ma , Jarkko Sakkinen Subject: [PATCH 6.18 635/703] KEYS: Use kfree_sensitive() in keyctl_pkey_e_d_s() Date: Fri, 4 Dec 2026 19:08:54 +0900 Message-ID: <20261204100644.676436080@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guicai Ma commit f779bd424bf27e17cee57c94f068328be29f3662 upstream. keyctl_pkey_e_d_s() frees the temporary 'in' and 'out' buffers with kfree(). For encrypt, decrypt and sign operations these buffers hold plaintext or other sensitive data. Free them with kfree_sensitive() instead. Closes: https://sashiko.dev/#/bug/linux-4199b169-0b8d-4055-9a71-6b5b79e38eb3 Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]") Cc: stable@vger.kernel.org Signed-off-by: Guicai Ma Link: https://lore.kernel.org/r/20261124052849.940005-1-maguicai@kylinos.cn Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- security/keys/keyctl_pkey.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/security/keys/keyctl_pkey.c +++ b/security/keys/keyctl_pkey.c @@ -323,9 +323,9 @@ out_up_key_sem: ret = -EFAULT; error_out: - kfree(out); + kfree_sensitive(out); error_in: - kfree(in); + kfree_sensitive(in); error_params: keyctl_pkey_params_free(¶ms); return ret;