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=1796381452; b=1BAbpKODxSlTvjBE/lzrfX/ypDfst4bctf/Ho34quooe+6tGiVBtngh4kjJ63iPiPZfw K0YiXP/WBLbXvnFgMGZbmK6NpfhEoGP8EGNB5oY+tlC9crhOHHz4MWcRD7hDa5UiUOAiv Cy27RMGRKjyepfc+7cgX+yYDg33UN175ZXiXJXtp+0Tzn4soDT5iK7Q/sQ2Y+M2bmC8TF JZ5iswBhjiDzfHggTlLCgIH0VRBE49p69Q3dtmLUD9/q/vEIzYeccEpy4g5mNutgTUcXH 6sm63zf04yIWgBlEKoKYtW4iDqyOLHqAwd0rUuwq6dM7vk4a4/ZfwgYmq3itAjWGqDw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381452; 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=WSU8L3tY7vJf0nWXnqnbd+Y5s9040OjMCXAHwTLBKJg=; b=E/Hlic6ddgWQlQK9o7zC76PuMoRLlzcWSIHfIlnYH5LqB8uV81SbBKIAHesuzQo3BDgd 8n9bjf8+zMXrVK/AP7623GyiQxDXcizNrrRR6u4s1K7qOyJOgi8uMlnWUBOn3aaeS8sKQ 9t2oAC+Sw6IPzBbIssw2Wx2X5Dwk7H6aU3lHjF/K2hy9kHHxWZLwabqKRgxdUHYoBQZBt w1zmWJe9HUbJrGxttb8Y692m8P8/bzPA9tgTknRxu1USmXHNRFxnu3Zd4r5wKC3lJUN36 UUrty1T/7wnNmMmJzwGIuDmVWR3JhHQl9x1CXIGKwBb4ekS2S0XaoMkdGkTjzcJSpmA== 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=rdurwNHU; 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 8E3E8606A32F; Fri, 4 Dec 2026 10:50:52 +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=rdurwNHU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0220B1F000C2; Fri, 4 Dec 2026 10:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381452; bh=WSU8L3tY7vJf0nWXnqnbd+Y5s9040OjMCXAHwTLBKJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rdurwNHUe08lLmxdiKJ3mkEEyIuo6sc3OprJWfiapJmZdKnbICS/9h0yR7Sr3dUFQ emziUfxbqHibM/l+2Ib/gJ2GjYtMa7Ox/r5d7e/lDHiRqXGQQkbZy+2ylOF/HMOYKX 2lcmfh6gwP6QGJPfnNV5eCpFBawlqA9ZalMTqbFY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guicai Ma , Jarkko Sakkinen Subject: [PATCH 7.3 711/742] KEYS: Use kfree_sensitive() in keyctl_pkey_e_d_s() Date: Fri, 4 Dec 2026 19:09:35 +0900 Message-ID: <20261204100653.963572317@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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;