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=1796384200; b=X7ee0ACBFQ9Zw/HXZpNF/a27MKKUBvA+GrC0bmQHqLPVeWJXIdf2M13sgrPyMzLjtB2i /aUx5aPM8yHK9Ij6Vngn++PqrOKgUrQPTnqMuGVkhfuS4no5RvC6sb6LbzZlVdcQ3GQfu 7qxgYH/RhIULtM7pvxxOZIisK2ZmeXTk2jGk/0vu0wmr/pSk07+EJxaZKL3VKORHunMJE SwoCGa1qi7NvS2X/dqC8HEg+tNmPNXqDkqnRu8qsrUnsmXDnI2G/q956UasJqev2tafyU 36lZZY3/Qgc4F5hd9lDkdEz7gZS92ez9VjqzPTzoafZOtd0pSUlmRdM1FlCBEbgHf3w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384200; 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=ZYxJHUqyRKjheZeJsV5RTJwGhuAg9Hyi2yAbf7BMgUw=; b=KgjzvfQOproUv6Vq7WvBv0xG4Zt2J/Ubq+0uzzRswBBv8qikDmormOgP4SKKAMgH6gnw zF+vhdlTQ9CJnZVkx4qf4l8N4iwlqStOnOmGtNXKGt6g00aZD3kdqnoma4/LMo83IRyQf +VNziYMazJSF7jGO5EtAJty2gCJ4WyNcefP5AfVP40EGcBfh/hA+ghyLPr51uGGjxug/C MOJZL63JUH5j8NDPSy8rZGZO2W7qMi98Dr68Ry8ZOoGz1axOfGyrXRP/OUb3qKFel0kNN 25qwNc1zrgffWkcNrC9OZa2IB4QfHp6XEdaRz5lJ6pdsiu3gMSd06IknYohEvKOm3lw== 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=nGbxaLkN; 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 1CAFA606A339; Fri, 4 Dec 2026 11:36: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=nGbxaLkN Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CB5F1F00933; Fri, 4 Dec 2026 11:36:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384200; bh=ZYxJHUqyRKjheZeJsV5RTJwGhuAg9Hyi2yAbf7BMgUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nGbxaLkNzFrRfE4Uuc6p7ocUkffxg50x6N2rQgfA6l2iW1+04XYffO2EXuBX72kp1 m+S6ssL8wr/s+GopB0t/1IHiEkJDcM0068uzob0LvlkbjBS4vjuqI8Ta8SnrRzwooO TuZoLdxTkRQlTPkjZFNiNVjURr1x8sRtZQZqV2II= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guicai Ma , Jarkko Sakkinen Subject: [PATCH 6.12 538/555] KEYS: Use kfree_sensitive() in keyctl_pkey_e_d_s() Date: Fri, 4 Dec 2026 19:09:41 +0900 Message-ID: <20261204100629.134334030@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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;